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

0.9.6.4, defaultIndexGenerator doesn't properly show file if its name contains Russian letters #225

Open
alogic0 opened this issue Feb 25, 2015 · 0 comments

Comments

@alogic0
Copy link

alogic0 commented Feb 25, 2015

Detected on Debian, Ubuntu, locale en_US.UTF-8. More precisely, it fails on characters in range \1024 - \1151, because T.decodeUtf8 thinks it is correct UTF-8 sequence. Problem is here
https://github.com/snapframework/snap-core/blob/0.9-stable/src/Snap/Util/FileServe.hs#L355
Example:

cpp -E FileServe.hs > tmp.hs
ghci tmp.hs
ghci> T.decodeUtf8 $ S.pack "йфыяхъ"
"9DKOEJ"

It must be exeption, but it isn't like in the case of Latin symbols:

ghci> T.decodeUtf8 $ S.pack "üéî"
"*** Exception: Cannot decode byte '\xfc' ...

So we need just do T.pack on such strings.

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