X-Git-Url: http://nitlanguage.org diff --git a/lib/string_experimentations/utf8.nit b/lib/string_experimentations/utf8.nit index 7261820..5feef35 100644 --- a/lib/string_experimentations/utf8.nit +++ b/lib/string_experimentations/utf8.nit @@ -354,6 +354,20 @@ redef class FlatString end +redef class FlatBuffer + + # Fix for this particular implementation + # + # Since the to_s of a FlatBuffer now builds using + # the old String contructor, this breaks everything. + # + # This will disappear when UTF8 is fully-supported + redef fun to_s do + written = false + return to_cstring.to_s_with_length(length) + end +end + redef class NativeString # Creates the index for said NativeString @@ -401,7 +415,7 @@ end redef class OFStream redef fun write(s) do - assert _writable + assert is_writable if s isa FlatText then if s isa FlatString then write_native(s.to_cstring, s.bytelen)