Skip to content

Commit 0803cee

Browse files
authored
Merge pull request #2 from ejschmitt/main
Update Yecc backend to parse unicode strings
2 parents 081460c + 1d44a67 commit 0803cee

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/json5/decode/backend/yecc.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defmodule Json5.Decode.Backend.Yecc do
2525
charlist
2626
|> :string.replace([92, 13, 10], [])
2727
|> :string.replace([92, 10], [])
28-
|> :erlang.iolist_to_binary()
28+
|> :unicode.characters_to_binary()
2929
end
3030

3131
defp to_term({:key, _, charlist}, config) do

test/json5/decode_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ defmodule Json5.DecodeTest do
1818
[:boolean, true, "true"],
1919
["string single quote", "some text", "'some text'"],
2020
["string double quote", "some text", "\"some text\""],
21+
["string unicode", "ūňĭčŏďē text", "\"ūňĭčŏďē text\""],
2122
["number hex", decimal(2801), "0xaf1"],
2223
["number hex", decimal(120_772), "0X1D7c4"],
2324
[:number, decimal(2801), "2801"],

0 commit comments

Comments
 (0)