`parse` crashes when text is unicode
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- erlang
- Domain
- backend
Research direction
Start at xml2map_ffi:value_to_bin/1, where the issue identifies the failing conversion, and reproduce the provided unicode XML assertion through xml2map.parse. Done means the assertion returns Ok("β") without an Erlang badarg error; check the surrounding FFI behavior for regressions.
Written by the indexing model from the issue text.
Description
The following code crashes with erlang:error(Badarg):
let decoder =
decode.field("#text", decode.string, decode.success)
|> decode.field("unicode_test", _, decode.success)
assert Ok("β") == echo xml2map.parse("<unicode_test>β</unicode_test>", decoder)
I was able to patch it by using unicode:characters_to_binary/1 instead of list_to_binary/1 in xml2map_ffi:value_to_bin/1:
value_to_bin(Value) when is_list(Value) ->
- list_to_binary(Value);
+ unicode:characters_to_binary(Value);
- Dominant language
- Erlang
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
area:ui bug effort:low incomplete model:light plan planner:gpt-6-1-sol
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
api: spanner
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/google-cloud-node#9513 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fossasia/eventyay#6151 · 1 comment ·
Maintainers usually reply within 1 day