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

Treatment of escaped vs unescaped Unicode character in JSON strings #7846

Open
scurest opened this issue May 12, 2024 · 0 comments
Open

Treatment of escaped vs unescaped Unicode character in JSON strings #7846

scurest opened this issue May 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working gltf Specific to glTF support

Comments

@scurest
Copy link

scurest commented May 12, 2024

Describe the bug
Escaped unicode characters in glTF are treated differently than unescaped ones.

"name": "\u4f60\u597d"         // escaped
"name": "你好"                 // unescaped

See also 2.7 JSON Encoding in the glTF spec: "Non-ASCII characters stored in glTF JSON MAY be escaped. [...] [Two examples differing only in string escaping] represent the same glTF JSON data."

To Reproduce

  1. Open EscapedUnicodeTest.glb.zip with bin/gltf_viewer from the latest release. Note that the node name is shown as \u4f60\u597d.
  2. Do the same with UnicodeTest.glb.zip. Note that the node name is shown as ??. (Presumably this is because the font doesn't have the correct glyphs. This issue is just about the discrepancy though, not the font.)

Expected behavior
No difference between these persists beyond the JSON loading phase.

Screenshots
With "\u4f60\u597d"

With "你好"

Desktop (please complete the following information):

  • OS: Linux
  • GPU:
  • Backend:

Additional context
The Blender glTF exporter currently writes the escaped form (it's the default for Python's builtin JSON library). A user presumably noticed the difference in Filament and reported a bug to Blender: https://projects.blender.org/blender/blender/issues/121692

@poweifeng poweifeng self-assigned this May 13, 2024
@pixelflinger pixelflinger added bug Something isn't working gltf Specific to glTF support labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gltf Specific to glTF support
Projects
None yet
Development

No branches or pull requests

3 participants