Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_writer: fix inverted sense in isAnyCharRequiredQuoting #1120

Merged

Commits on Dec 18, 2019

  1. json_writer: fix inverted sense in isAnyCharRequiredQuoting

    This bug is only affects platforms where `char` is unsigned.
    
    When char is a signed type, values >= 0x80 are also considered < 0,
    and hence require escaping due to the < ' ' condition.
    
    When char is an unsigned type, values >= 0x80 match none of the
    conditions and are considered safe to emit without escaping.
    
    This shows up as a test failure:
    
    * Detail of EscapeSequenceTest/writeEscapeSequence test failure:
    /build/source/src/test_lib_json/main.cpp(3370): expected == result
      Expected: '["\"","\\","\b","\f","\n","\r","\t","\u0278","\ud852\udf62"]
      '
      Actual  : '["\"","\\","\b","\f","\n","\r","\t","ɸ","𤭢"]
      '
    thefloweringash committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    9093358 View commit details
    Browse the repository at this point in the history