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

encoding/decoding error #6

Open
WilliamTambellini opened this issue Mar 14, 2023 · 0 comments
Open

encoding/decoding error #6

WilliamTambellini opened this issue Mar 14, 2023 · 0 comments

Comments

@WilliamTambellini
Copy link

Hi @m-popovic
Just an encoding/decoding error on windows:

Traceback (most recent call last):
  File "python-3.8.0\test\chrF++.py", line 232, in <module>
    main()
  File "python-3.8.0\test\chrF++.py", line 219, in main
    totalF, averageTotalF, totalPrec, totalRec = computeChrF(rtxt, htxt, args.nworder, args.ncorder, args.beta, sentence_level_scores)
  File "python-3.8.0\test\chrF++.py", line 124, in computeChrF
    for hline, rline in zip(fpHyp, fpRef):
  File "python-3.8.0\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 19: character maps to <undefined> 

It s just because you dont specify the encoding when opening the source files so windows defaults to cp1252 instead of utf8.
Specifying the utf-8 encoding does resolve the issue.
Do you consider PullRequest ?
Best

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