Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
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
videolan
vlc
Commits
0b49b59c
Commit
0b49b59c
authored
Feb 07, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IsUTF8: use clz
parent
15b6bc54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
src/text/unicode.c
src/text/unicode.c
+3
-8
No files found.
src/text/unicode.c
View file @
0b49b59c
...
...
@@ -286,25 +286,20 @@ static char *CheckUTF8( char *str, char rep )
for
(;;)
{
uint8_t
c
=
ptr
[
0
];
int
charlen
=
-
1
;
if
(
c
==
'\0'
)
break
;
for
(
int
i
=
0
;
i
<
7
;
i
++
)
if
((
c
>>
(
7
-
i
))
==
((
0xff
>>
(
7
-
i
))
^
1
))
{
charlen
=
i
;
break
;
}
if
(
c
>
0xF4
)
goto
error
;
int
charlen
=
clz8
(
c
^
0xFF
);
switch
(
charlen
)
{
case
0
:
// 7-bit ASCII character -> OK
ptr
++
;
continue
;
case
-
1
:
// 1111111x -> error
case
1
:
// continuation byte -> error
goto
error
;
}
...
...
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