Skip to content

Sorting Problem with Unicode Character Ordering #3

Closed
@marcelotto

Description

@marcelotto

I encountered a sorting issue in this JCS implementation when using it in my JSON-LD.ex library while updating it to conform to the JSON-LD 1.1 specification. When running the W3C test suite, specifically test tjs13, the test is failing due to incorrect ordering of Unicode characters.

Input JSON

{
  "\u20ac": "Euro Sign",
  "\r": "Carriage Return",
  "\u000a": "Newline",
  "1": "One",
  "\u0080": "Control\u007f",
  "\ud83d\ude02": "Smiley",
  "\u00f6": "Latin Small Letter O With Diaeresis",
  "</script>": "Browser Challenge"
}

Expected output

{"\u000a":"Newline","\r":"Carriage Return","1":"One","</script>":"Browser Challenge","\u0080": "Control\u007f","\u00f6":"Latin Small Letter O With Diaeresis","\u20ac":"Euro Sign","\ud83d\ude02":"Smiley"}

Actual output

{"1":"One","</script>":"Browser Challenge","\u000a":"Newline","\r":"Carriage Return","\u0080":"Control ","\u00f6":"Latin Small Letter O With Diaeresis","\u20ac":"Euro Sign","\ud83d\ude02":"Smiley"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions