Author: dajobe
Date: Thu Jan 17 05:36:27 2008
New Revision: 13612

URL: http://svn.librdf.org/view?rev=3D13612&view=3Drev
Log:
(raptor_iostream_write_string_python): Do not write too much raw UTF-8

Modified:
    raptor/trunk/src/raptor_turtle_writer.c

Modified: raptor/trunk/src/raptor_turtle_writer.c
URL: http://svn.librdf.org/view/raptor/trunk/src/raptor_turtle_writer.c?rev=
=3D13612&r1=3D13611&r2=3D13612&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- raptor/trunk/src/raptor_turtle_writer.c (original)
+++ raptor/trunk/src/raptor_turtle_writer.c Thu Jan 17 05:36:27 2008
@@ -459,12 +459,12 @@
       /* UTF-8 encoding had an error or ended in the middle of a string */
       return 1;
 =

-    unichar_len=3Draptor_utf8_to_unicode_char(&unichar, string, len);
-
     if(flags >=3D 1 && flags <=3D 3) {
       /* Turtle and JSON are UTF-8 - no need to escape */
-      raptor_iostream_write_counted_string(iostr, string, len);
+      raptor_iostream_write_counted_string(iostr, string, unichar_len);
     } else {
+      unichar_len=3Draptor_utf8_to_unicode_char(&unichar, string, len);
+
       if(unichar < 0x10000) {
         raptor_iostream_write_counted_string(iostr, "\\u", 2);
         raptor_iostream_format_hexadecimal(iostr, unichar, 4);


_______________________________________________
redland-commits mailing list
[email protected]
http://lists.librdf.org/mailman/listinfo/redland-commits

Reply via email to