text: use UInt32 to manipulate chars
[nit.git] / lib / json / static.nit
index 3b830a2..f5eef1d 100644 (file)
@@ -28,6 +28,7 @@ private import json_lexer
 
 # Something that can be translated to JSON.
 interface Jsonable
+       super Serializable
 end
 
 redef class Text
@@ -80,7 +81,7 @@ redef class Text
                                                if self[i + 5] == '\\' and self[i + 6] == 'u' then
                                                        u16_esc <<= 16
                                                        u16_esc += from_utf16_digit(i + 7)
-                                                       char = u16_esc.from_utf16_surr.code_point
+                                                       char = u16_esc.to_u32.from_utf16_surr.code_point
                                                        i += 6
                                                else
                                                        char = 0xFFFD.code_point