Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MobiusMei
ygopro
Commits
022eed1a
Commit
022eed1a
authored
Mar 26, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecodeUTF8()
parent
1f987b40
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
gframe/bufferio.h
gframe/bufferio.h
+5
-3
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/bufferio.h
View file @
022eed1a
...
@@ -60,6 +60,7 @@ public:
...
@@ -60,6 +60,7 @@ public:
*
pstr
=
0
;
*
pstr
=
0
;
return
l
;
return
l
;
}
}
// UCS-2 to UTF-8
static
int
EncodeUTF8
(
const
wchar_t
*
wsrc
,
char
*
str
)
{
static
int
EncodeUTF8
(
const
wchar_t
*
wsrc
,
char
*
str
)
{
char
*
pstr
=
str
;
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
while
(
*
wsrc
!=
0
)
{
...
@@ -81,6 +82,7 @@ public:
...
@@ -81,6 +82,7 @@ public:
*
str
=
0
;
*
str
=
0
;
return
str
-
pstr
;
return
str
-
pstr
;
}
}
// UTF-8 to UCS-2
static
int
DecodeUTF8
(
const
char
*
src
,
wchar_t
*
wstr
)
{
static
int
DecodeUTF8
(
const
char
*
src
,
wchar_t
*
wstr
)
{
const
char
*
p
=
src
;
const
char
*
p
=
src
;
wchar_t
*
wp
=
wstr
;
wchar_t
*
wp
=
wstr
;
...
@@ -89,13 +91,13 @@ public:
...
@@ -89,13 +91,13 @@ public:
*
wp
=
*
p
;
*
wp
=
*
p
;
p
++
;
p
++
;
}
else
if
((
*
p
&
0xe0
)
==
0xc0
)
{
}
else
if
((
*
p
&
0xe0
)
==
0xc0
)
{
*
wp
=
(((
int
)
p
[
0
]
&
0x1f
)
<<
6
)
|
((
int
)
p
[
1
]
&
0x3f
);
*
wp
=
(((
unsigned
)
p
[
0
]
&
0x1f
)
<<
6
)
|
((
unsigned
)
p
[
1
]
&
0x3f
);
p
+=
2
;
p
+=
2
;
}
else
if
((
*
p
&
0xf0
)
==
0xe0
)
{
}
else
if
((
*
p
&
0xf0
)
==
0xe0
)
{
*
wp
=
(((
int
)
p
[
0
]
&
0xf
)
<<
12
)
|
(((
int
)
p
[
1
]
&
0x3f
)
<<
6
)
|
((
int
)
p
[
2
]
&
0x3f
);
*
wp
=
(((
unsigned
)
p
[
0
]
&
0xf
)
<<
12
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
2
]
&
0x3f
);
p
+=
3
;
p
+=
3
;
}
else
if
((
*
p
&
0xf8
)
==
0xf0
)
{
}
else
if
((
*
p
&
0xf8
)
==
0xf0
)
{
*
wp
=
(((
int
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
int
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
int
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
int
)
p
[
3
]
&
0x3f
);
*
wp
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
p
+=
4
;
p
+=
4
;
}
else
}
else
p
++
;
p
++
;
...
...
ocgcore
@
95bc5de8
Subproject commit
35927886a1effa6c8a2eccaa1eff2eb84e859
5b3
Subproject commit
95bc5de881cc3b0b6108b0236ecce197a40af
5b3
script
@
eda89570
Subproject commit
9da642fec10fcc0cf90041d5ded55db02a4b619c
Subproject commit
eda89570a613c7ba4e7e23a36b2c66a8420cbc61
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment