strange characters after 'quick start'

96 views
Skip to first unread message

kees Bleijenberg

unread,
Nov 24, 2016, 7:44:29 AM11/24/16
to Yesod Web Framework
I've installed Yesod according to the 'quick start' 
Installation goes fine. When I open the website I see strange characters.
The html is: <div class="row"><h1 class="header">YesodÔÇöa modern framework for blazing fast websites</h1>
This error is in Chrome and in IE. What's wrong and what shoud ÔC be?

Michael Snoyman

unread,
Nov 24, 2016, 8:26:55 AM11/24/16
to yeso...@googlegroups.com
That sounds like a character encoding issue. What do you get with the following?

    curl -i -X HEAD http://localhost:3000

It should ideally include:

    Content-Type: text/html; charset=utf-8

Also, is there any chance that you've explicitly set a character encoding in your browser instead of leaving it to auto-detect? Is the problem resolved by explicitly choosing a UTF-8 character encoding?

--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kees Bleijenberg

unread,
Dec 18, 2016, 7:31:20 AM12/18/16
to Yesod Web Framework, mic...@snoyman.com
I did the curl and this is the response:
d:\yesod-devel> curl -i -X HEAD http://localhost:3000
Warning: Setting custom HTTP method to HEAD with -X/--request may not work the
Warning: way you want. Consider using -I/--head instead.
HTTP/1.1 200 OK
Date: Sun, 18 Dec 2016 12:05:07 GMT
Server: Warp/3.2.9
Content-Type: text/html; charset=utf-8
Set-Cookie: _SESSION=T1ymjJGg0cytv0w+jMN+B0aVgvY+KpYHosZz11ajj4Xjn8rPWqeMoVVUJUw
aYTBEflp9pErI0Tdj1P4HDEEQMCBW2qHFLlZ5ZbPsVuYmiw+S8b4R3OlFwrZMUjY1FsqxnfQFt1rCG4A
=; Path=/; Expires=Sun, 18-Dec-2016 14:05:07 GMT; HttpOnly
Vary: Accept, Accept-Language

Indeed text/html and charset utf-8. If I open the page in IE (autodetect mode) it say unicode (utf8) and it shows the wrong characters.
In Chrome the same page shows also the wrong characters. In chrome I couldn't find the settings for the page encoding (missing 'tools'  item in menu). But I'am 99% sure I did not change that setting. The fact that IE shows the same error is maybe an indication of another reason for this error.

Kees
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.

kees Bleijenberg

unread,
Dec 19, 2016, 4:43:31 AM12/19/16
to Yesod Web Framework, mic...@snoyman.com
I've loaded the webpage in Chrome (running on another Linux computer) from the server running on Windows. I get the same error.

In another Yesod project (also running on Windows) I added the line äöëéáó to a hamlet file. No errors in Chrome or IE,
Maybe this is a encoding error of that special character used in the 'quick start' project on Windows?

Kees


On Thursday, November 24, 2016 at 2:26:55 PM UTC+1, Michael Snoyman wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.

Michael Snoyman

unread,
Dec 19, 2016, 5:16:45 AM12/19/16
to yeso...@googlegroups.com
Can you attach the raw Hamlet file generating the problematic content?

To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe@googlegroups.com.

kees Bleijenberg

unread,
Dec 20, 2016, 3:58:00 AM12/20/16
to Yesod Web Framework, mic...@snoyman.com
Obviously there is something wrong in the attached file. Notepad++ thinks the hamlet file is utf-8 but the file has strange characters too.

Kees
homepage.hamlet

Michael Snoyman

unread,
Dec 21, 2016, 7:39:40 AM12/21/16
to yeso...@googlegroups.com
Can you try starting a brand new project with `stack new somename yesod-sqlite` and see if the same problem exists? I can confirm that on my Mac there are no character encoding issues, but I don't have easy access to a Windows machine. If just `stack new` is causing the problem, then there must be some character encoding bug in Stack. Though looking at the relevant code, I don't see what it could be.

To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe@googlegroups.com.

kees Bleijenberg

unread,
Dec 21, 2016, 10:27:57 AM12/21/16
to Yesod Web Framework, mic...@snoyman.com
The homepage.hamlet I've send in my previous post is (!) from a brand new project with sqlite.
Maybe I can help by doing a few tests on Windows. If so, let me know what I can do. I wonder if this is not an error in a utf-8 encoding library (maybe not in Yesod) for one special character.

Kees

Michael Snoyman

unread,
Dec 21, 2016, 10:41:38 AM12/21/16
to yeso...@googlegroups.com
I was going to send you the link to the Stack code that relates to this... and accidentally found the bug:


This should be using binary read functions instead of relying on Data.Text.IO. I've opened up a PR to fix this:


It would be helpful if you could check out that branch, `stack install` inside of it, and try the new stack executable to see if it fixes the problem.

To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe@googlegroups.com.

kees Bleijenberg

unread,
Dec 22, 2016, 5:08:05 AM12/22/16
to Yesod Web Framework, mic...@snoyman.com
I don't know how to get the source with the pull request applied. Therefore I downloaded the source in a zip (button 'clone or download') and manually applied the changes from the pull request, build a new stack.exe and replaced all existing stack.exe. Then I made a new project and the strange characters are gone. Success!?

Michael Snoyman

unread,
Dec 22, 2016, 5:21:42 AM12/22/16
to yeso...@googlegroups.com
Awesome, thanks for confirming. I'll merge that PR in.

To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages