Fix "JSON char > 127 codepage problem""

[cherry-picked from master]