nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename `NativeString` to `CString`
[nit.git]
/
lib
/
core
/
codecs
/
utf8.nit
diff --git
a/lib/core/codecs/utf8.nit
b/lib/core/codecs/utf8.nit
index
bb257dd
..
debb3f5
100644
(file)
--- a/
lib/core/codecs/utf8.nit
+++ b/
lib/core/codecs/utf8.nit
@@
-30,7
+30,7
@@
private class UTF8Codec
redef fun max_lookahead do return 4
redef fun encode_char(c) do
redef fun max_lookahead do return 4
redef fun encode_char(c) do
- var ns = new NativeString(c.u8char_len)
+ var ns = new CString(c.u8char_len)
add_char_to(c, ns)
return ns
end
add_char_to(c, ns)
return ns
end
@@
-41,14
+41,14
@@
private class UTF8Codec
end
redef fun encode_string(s) do
end
redef fun encode_string(s) do
- var buf = new Bytes.with_capacity(s.bytelen)
+ var buf = new Bytes.with_capacity(s.byte_length)
add_string_to(s, buf)
return buf
end
redef fun add_string_to(s, b) do
s.append_to_bytes(b)
add_string_to(s, buf)
return buf
end
redef fun add_string_to(s, b) do
s.append_to_bytes(b)
- return s.bytelen
+ return s.byte_length
end
redef fun is_valid_char(ns, len) do
end
redef fun is_valid_char(ns, len) do
@@
-71,9
+71,9
@@
private class UTF8Codec
var ret = ns.to_s_with_length(len)
var rit = ret.as(FlatString).items
if rit == ns then
var ret = ns.to_s_with_length(len)
var rit = ret.as(FlatString).items
if rit == ns then
- var nns = new NativeString(len)
+ var nns = new CString(len)
rit.copy_to(nns, len, 0, 0)
rit.copy_to(nns, len, 0, 0)
- return nns.to_s_full(ret.bytelen, ret.length)
+ return nns.to_s_full(ret.byte_length, ret.length)
end
return ret
end
end
return ret
end