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




commit e27dc7a006ba68976c322c2189116f95ce6636d2
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]