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

UnicodeConversionError - Error message doesn't tell where the error is occurring #47

Closed
sashaafm opened this issue Mar 2, 2016 · 8 comments
Assignees

Comments

@sashaafm
Copy link

sashaafm commented Mar 2, 2016

I'm getting the following

sashaafm@LXLE:~/Documents/nomad$ mix credo --explain
Checking 8 source files ...
** (UnicodeConversionError) invalid encoding starting at <<211, 32, 69, 83, 84, 193, 32, 80, 65, 82, 65, 32, 77, 89, 83, 81, 76, 32, 35, 35, 35, 35, 10, 32, 32, 100, 101, 102, 112, 32, 98, 115, 32, 100, 111, 10, 32, 32, 32, 32, 34, 34, 34, 10, 32, 32, 32, 32, 32, 32, ...>>
(elixir) lib/string.ex:1634: String.to_char_list/1
lib/credo/code.ex:62: Credo.Code.to_tokens/1
lib/credo/check/consistency/space_around_operators/without_space.ex:16: Credo.Check.Consistency.SpaceAroundOperators.WithoutSpace.property_values_for/2
lib/credo/check/consistency/helper.ex:152: anonymous fn/4 in Credo.Check.Consistency.Helper.collect_property_values/3
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
lib/credo/check/consistency/helper.ex:144: Credo.Check.Consistency.Helper.property_list_for/3
lib/credo/check/consistency/helper.ex:138: Credo.Check.Consistency.Helper.create_property_tuples/3
(elixir) lib/enum.ex:1088: Enum."-map/2-lists^map/1-0-"/2

I don't understand where the error is coming from? It wasn't warning about anything in the last commit and I didn't do many changes. I can try to give more information if needed.

@rrrene
Copy link
Owner

rrrene commented Mar 2, 2016

That does not sound good. Could you provide a bit more context? Are there any special Unicode characters in any of the files, for example in strings or comments?

@rrrene rrrene self-assigned this Mar 2, 2016
@murphy1312
Copy link

same error for me as well,

(UnicodeConversionError) invalid encoding starting at <<180, 115, 32, 116, 111, 32, 111, 112, 101, 110, 32, 115, 97, 118, 101, 32, 97, 115, 32, 100, 105, 97, 108, 111, 103, 10, 32, 32, 32, 32, 32, 32, 124, 62, 32, 112, 117, 116, 95, 114, 101, 115, 112, 95, 104, 101, 97, 100, 101, 114, ...>>
    (elixir) lib/string.ex:1634: String.to_char_list/1
    lib/credo/code.ex:62: Credo.Code.to_tokens/1
    lib/credo/check/consistency/space_around_operators/without_space.ex:16: Credo.Check.Consistency.SpaceAroundOperators.WithoutSpace.property_values_for/2
    lib/credo/check/consistency/helper.ex:152: anonymous fn/4 in Credo.Check.Consistency.Helper.collect_property_values/3
    (elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/credo/check/consistency/helper.ex:144: Credo.Check.Consistency.Helper.property_list_for/3
    lib/credo/check/consistency/helper.ex:138: Credo.Check.Consistency.Helper.create_property_tuples/3
    (elixir) lib/enum.ex:1088: Enum."-map/2-lists^map/1-0-"/2

@sashaafm
Copy link
Author

@rrrene I'm sorry I never came back to you.

It was a special unicode character in a comment. Today I had it again. @murphy1312 that's probably the same problem for you.

@rrrene Do you think it's possible to find the line where the error is happening and tell the user? This is really bad for people like me whose native language has a lot of special unicode chars and from time to time will write comments in their language (I try to stick to English because of this type of problem, but when you're pissed off at something it's hard to remember ahah)

@rrrene
Copy link
Owner

rrrene commented Mar 14, 2016

@sashaafm Absolutely. Can you provide an example comment containing some of these characters so I can write a test against it?

@sashaafm
Copy link
Author

@rrrene yes, of course, the problem I had today was because of a comment similar to this:

# WARNING: NÃO ESTÁ A FUNCIONAR
(WARNING: IT DOESN'T WORK)

@murphy1312
Copy link

for me it was the " ´ " character - 180 - in
#"tell the most browser´s to open"

rrrene added a commit that referenced this issue Mar 15, 2016
rrrene added a commit that referenced this issue Mar 15, 2016
@rrrene rrrene closed this as completed in 051ec43 Mar 24, 2016
@rrrene
Copy link
Owner

rrrene commented Mar 24, 2016

This should finally be fixed in v0.3.10 ... Can you confirm?

@hykw
Copy link

hykw commented Mar 25, 2016

The same error had occurred for me too, but it's been fixed in v0.3.10!

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

4 participants