Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belr
Commits
7f03415a
Commit
7f03415a
authored
Dec 08, 2015
by
Sylvain Berfini
🐮
Browse files
Fix UTF8 issue
parent
98e4cb9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/belr.cc
src/belr.cc
+5
-4
No files found.
src/belr.cc
View file @
7f03415a
...
...
@@ -112,10 +112,11 @@ CharRecognizer::CharRecognizer(int to_recognize, bool caseSensitive) : mToRecogn
}
size_t
CharRecognizer
::
_feed
(
const
shared_ptr
<
ParserContextBase
>
&
ctx
,
const
string
&
input
,
size_t
pos
){
int
c
=
(
unsigned
char
)
input
[
pos
];
if
(
mCaseSensitive
){
return
input
[
pos
]
==
mToRecognize
?
1
:
string
::
npos
;
return
c
==
mToRecognize
?
1
:
string
::
npos
;
}
return
::
tolower
(
input
[
pos
])
==
mToRecognize
?
1
:
string
::
npos
;
return
::
tolower
(
c
)
==
mToRecognize
?
1
:
string
::
npos
;
}
void
CharRecognizer
::
_optimize
(
int
recursionLevel
){
...
...
@@ -294,8 +295,8 @@ CharRange::CharRange(int begin, int end) : mBegin(begin), mEnd(end){
}
size_t
CharRange
::
_feed
(
const
shared_ptr
<
ParserContextBase
>
&
ctx
,
const
string
&
input
,
size_t
pos
){
int
c
=
input
[
pos
];
if
(
c
>=
mBegin
&&
c
<=
mEnd
)
return
1
;
int
c
=
(
unsigned
char
)
input
[
pos
];
if
(
c
>=
mBegin
&&
c
<=
mEnd
)
return
1
;
return
string
::
npos
;
}
...
...
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