nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Migration from ascii to code_point
[nit.git]
/
lib
/
core
/
text
/
native.nit
diff --git
a/lib/core/text/native.nit
b/lib/core/text/native.nit
index
5a74cd1
..
4028ea0
100644
(file)
--- a/
lib/core/text/native.nit
+++ b/
lib/core/text/native.nit
@@
-16,7
+16,7
@@
import math
redef class Byte
# Gives the length of the UTF-8 char starting with `self`
redef class Byte
# Gives the length of the UTF-8 char starting with `self`
- private fun u8len: Int do
+ fun u8len: Int do
if self & 0b1000_0000u8 == 0u8 then
return 1
else if self & 0b1110_0000u8 == 0b1100_0000u8 then
if self & 0b1000_0000u8 == 0u8 then
return 1
else if self & 0b1110_0000u8 == 0b1100_0000u8 then
@@
-130,7
+130,7
@@
extern class NativeString `{ char* `}
return ns_i
end
return ns_i
end
- # Gets the byte index of char at position `n` in UTF-8 String
+ # Gets the char index of byte at position `n` in a UTF-8 String
#
# `char_from` and `byte_from` are cached values to seek from.
#
#
# `char_from` and `byte_from` are cached values to seek from.
#