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

Error when parsing soft hyphens #182

Open
eteubert opened this issue Oct 16, 2018 · 0 comments
Open

Error when parsing soft hyphens #182

eteubert opened this issue Oct 16, 2018 · 0 comments

Comments

@eteubert
Copy link

eteubert commented Oct 16, 2018

iex ▶ '\u00AD'
[173]

iex ▶ Poison.encode(<<173, 144>>)

▶▶▶
** (FunctionClauseError) no function clause matching in Poison.Encoder.BitString.chunk_size/3    
    
    The following arguments were given to Poison.Encoder.BitString.chunk_size/3:
    
        # 1
        <<173, 144>>
    
        # 2
        nil
    
        # 3
        0
    
    Attempted function clauses (showing 7 out of 7):
    
        defp chunk_size(<<char::integer(), _::binary()>>, _mode, acc) when char <= 31 or (char === 92 or char === 34)
        defp chunk_size(<<char::integer(), rest::binary()>>, mode, acc) when char < 128
        defp chunk_size(<<_::utf8(), _::binary()>>, :unicode, acc)
        defp chunk_size(<<char::utf8(), _::binary()>>, :javascript, acc) when char === 8233 or char === 8232
        defp chunk_size(<<codepoint::utf8(), rest::binary()>>, mode, acc)
        defp chunk_size(<<char::integer()>>, _, _)
        defp chunk_size("", _, acc)
    
    (poison) lib/poison/encoder.ex:139: Poison.Encoder.BitString.chunk_size/3
    (poison) lib/poison/encoder.ex:134: Poison.Encoder.BitString.escape/2
    (poison) lib/poison/encoder.ex:88: Poison.Encoder.BitString.encode/2
    (poison) lib/poison.ex:41: Poison.encode!/2
    (poison) lib/poison.ex:15: Poison.encode/2

See https://en.wikipedia.org/wiki/Soft_hyphen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant