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

Polish letters encoded as utf-8 in strings are mangled by loading through configurator #30

Open
ajuc opened this issue Oct 14, 2017 · 0 comments

Comments

@ajuc
Copy link

ajuc commented Oct 14, 2017

I'm new at Haskell, so maybe I misunderstand something, but it seems to me that utf-8 non-latin characters should be handled the same way when loaded from utf-8 file through this library, as they are handled when entered directly in the code. As it is now - they aren't.

Test case:

polishLettersTest :: Assertion
polishLettersTest =
  withLoad "utf8_polish_letters.cfg" $ \cfg -> do
    testString  <- lookup cfg "test"
    assertEqual "string property" testString $ (Just "Zażółć gęślą jaźń" :: Maybe Text)

for file utf8_polish_letters.cfg which contains:
test = "Zażółć gęślą jaźń"

On the current version cloned from github today it fails for me with:

polishLettersTest: [Failed]
string property
expected: Just "Za\9532\9565\9500\9474\9532\233\9472\231 g\9472\214\9532\356l\9472\367 ja\9532\9553\9532\228"
 but got: Just "Za\380\243\322\263 g\281\347l\261 ja\378\324"

Maybe I misunderstood the documentation, and utf-8 isn't supposed to be supported? I discovered the problem when I build the sample Spock application https://github.com/agrafix/funblog , and changed the displayed name of the website in configuration to a string with Polish letters.

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