You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently umlaute as "ä", "ö" a.s.o are failing in lobster-json if the json file is saved with encoding ISO-8859-1, because lobster-json is trying to read it with utf-8 encoding. lobster-json should not fail in these cases, but should support also other encodings.
One possibility is to use this code snippet to guess the encoding with a certain confidence:
importchardetwithopen('example.txt', 'rb') asfile:
result=chardet.detect(file.read())
encoding=result['encoding']
confidence=result['confidence']
print(f"The file is encoded in '{encoding}' with confidence {confidence*100:.2f}%.")
If the confidence is above a threshold, we could take it as granted. We could add a command line flag like --detect-encoding=80 to specify that the encoding shall be detected, and that the confidence level must be at least 80%.
Currently umlaute as "ä", "ö" a.s.o are failing in
lobster-json
if the json file is saved with encoding ISO-8859-1, becauselobster-json
is trying to read it with utf-8 encoding.lobster-json
should not fail in these cases, but should support also other encodings.This may be a solution on how to detect the encoding:
https://www.powershellgallery.com/packages/poshfunctions/2.2.1.1/content/functions/get-fileencoding.ps1
Acceptance Criterias:
lobster doesn't fail when using "Umlaute" in testcase json files in common encodings like:
The text was updated successfully, but these errors were encountered: