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

JsonResponse: escape unicode #201

Open
milo opened this issue May 31, 2018 · 0 comments
Open

JsonResponse: escape unicode #201

milo opened this issue May 31, 2018 · 0 comments

Comments

@milo
Copy link
Member

milo commented May 31, 2018

Version: dev (73742cf)

Bug Description

JsonRespose uses Json::encode(). It has default flag JSON_UNESCAPED_UNICODE set.

For example, encoding result of ["Předměty"] is:

["Předměty"]

When I decode such data in PowerShell (v5.1 on Windows Server 2012):

$json = Invoke-WebRequest 'http://localhost/export/students-in-courses'
$data = $json | ConvertFrom-Json

I get malformed output like P??edm??ty.

Without mentioned flag, json looks like followed and decoding is fine:

["P\u0159edm\u011bty"]

Honestly, I don't know much about JSON standard, so I don't know how problematic BC break it is. And maybe it is an issue of PowerShell at all, I didn't find any relevant info.

As a workaround I use CallbackResponse and own JSON encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant