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




commit 6c94a90ccdfbdba8fa6b90d7b7ba5ede66166bbf
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.

 pango/json/gtkjsonprinter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango/json/gtkjsonprinter.c b/pango/json/gtkjsonprinter.c
index e9ca03a3b..ec1b7e919 100644
--- a/pango/json/gtkjsonprinter.c
+++ b/pango/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]