Explorar el Código

Allow for utf8 strings

Hugh Sanderson hace 16 años
padre
commit
e3b8c7d42a
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      gencpp.ml

+ 3 - 2
gencpp.ml

@@ -470,8 +470,9 @@ let has_utf8_chars s =
 let quote s =
 	(if (has_utf8_chars s) then escape_string else escape_stringw) (Ast.s_escape s);;
 
-let str s = "STRING(" ^ (quote s) ^ "," ^ (string_of_int (String.length s)) ^ ")";;
-
+let str s =
+	(if (has_utf8_chars s) then "STRING_UTF8(" else "STRING(") ^
+	(quote s) ^ "," ^ (string_of_int (String.length s)) ^ ")";;
 
 (* When we are in a "real" object, we refer to ourselves as "this", but
 	if we are in a local class that is used to generate return values,