[pango/pango2-windows: 8/10] gtkjsonprinter.c: Don't check for <0x20 to output \uXXXX strings




commit a643ebe8752e04e4d21989588f881216d7bb8848
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jun 20 16:23:07 2022 +0800

    gtkjsonprinter.c: Don't check for <0x20 to output \uXXXX strings
    
    Apparently the check for character values less than 0x20 to determine
    whether to output \uXXXX in leau of the actual UTF-8 strings break the
    layout test on Windows.
    
    Just print the UTF-8 string as-is unless specifically set to output only
    ascii lines.

 pango2/json/gtkjsonprinter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango2/json/gtkjsonprinter.c b/pango2/json/gtkjsonprinter.c
index e9ca03a3b..ec1b7e919 100644
--- a/pango2/json/gtkjsonprinter.c
+++ b/pango2/json/gtkjsonprinter.c
@@ -228,7 +228,7 @@ gtk_json_printer_escape_string (GtkJsonPrinter *self,
           default:
             if ((int) *str < 0x20 || (int) *str >= 0x80)
               {
-                if ((guint) *str < 0x20 || gtk_json_printer_has_flag (self, GTK_JSON_PRINTER_ASCII))
+                if (gtk_json_printer_has_flag (self, GTK_JSON_PRINTER_ASCII))
                   g_string_append_printf (string, "\\u%04x", g_utf8_get_char (str));
                 else
                   g_string_append_unichar (string, g_utf8_get_char (str));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]