Skip to content

JsonResponse: escape unicode #201

Open
@milo

Description

@milo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions