File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ defmodule Poison.ParseError do
23
23
end
24
24
25
25
defp escape ( token ) do
26
- { value , _ } = Identifier . escape ( << token >> , ?\\ )
26
+ { value , _ } = Identifier . escape ( << token :: utf8 >> , ?\\ )
27
27
value
28
28
end
29
29
end
@@ -350,7 +350,7 @@ defmodule Poison.Parser do
350
350
## Errors
351
351
352
352
defp syntax_error ( << token :: utf8 >> <> _ , pos ) do
353
- raise % ParseError { pos: pos , value: << token >> }
353
+ raise % ParseError { pos: pos , value: << token :: utf8 >> }
354
354
end
355
355
356
356
defp syntax_error ( _ , pos ) do
Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ defmodule Poison.ParserTest do
88
88
parse! ( ~s( "𝄞) )
89
89
end
90
90
91
+ assert_raise ParseError , "Unexpected token at position 0: á" , fn ->
92
+ parse! ( ~s( á) )
93
+ end
94
+
91
95
assert_raise ParseError , "Unexpected token at position 0: \\ x1F" , fn ->
92
96
parse! ( ~s( \u001F ) )
93
97
end
You can’t perform that action at this time.
0 commit comments