2010/8/12 James Reeves <jree...@weavejester.com>:
> On 12 August 2010 14:33, limux <liumengji...@gmail.com> wrote:
>> The solution in http://tiny.cc/3cmrx is useful, thanks.
>> That what cause the issue should be compojure. That thread's time is
>> 6, June.
>> and compjure haven't fixed it.
>
> The solution you mention is some middleware that sets the content-type
> charset header to a specific value.
>
> Has this fixed the issue? I was under the impression from Rasmus's
> post that raw strings worked fine, and it was just an issue with
> Hiccup.
>
> However, that in itself is odd, as Hiccup only uses raw strings and
> the str function to join them together. I believe this should maintain
> the correct string encoding. So assuming both str and literal strings
> work, Hiccup should work.
>
> I guess we need to determine whether the string itself has the wrong
> encoding, or whether an incorrect encoding has been specified in the
> content type.
>
> - James
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

>From what I can tell, the problem he had was caused by compojure's
default content type "text/html" being replaced by "text/html;
charset=iso8859-1". If he added the charset attribute (with the
middleware proposed in the link) the problem went away.

I asked him to check the page info in firefox to see what content-type
the web server served. Without the middleware, it was "text/html;
charset=iso8859-1" and with it, it was "text/html; charset=utf-8", as
expected. The only value existing in the compojure code is
"text/html", iirc.

It appears that Jetty rewrites any text/html content type it serves
and adds a charset attribute (maybe with the dreaded "OS default
charset" as its value) if there isn't one.

Time for some tests, maybe?

// Rasmus

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to