All most of the ring sample I can see have a response map as {"Content-Type" "text/html"} without adding a kind of charset.
I will spend some time to test Rack to see if there is the same issue. Concretely, to see Rack will add a charset if there is no one in response. or It will action like Ring to see those response pass through directly. I know Ring looks like Rack. On 8月13日, 上午10时36分, limux <liumengji...@gmail.com> wrote: > Perhaps Jetty add a charset of iso-8859-1 if there isn't one in > response. > At the same time, in Compojure, it add none of the charset when a > string is rendered. The headers has only a few info exactly as > {"Content-Type" "text/html"}. > So perhaps Jetty will add a old charset iso-8859-1. That's all! Maybe? > > Regards. > > On 8月13日, 上午2时25分, Rasmus Svensson <r...@lysator.liu.se> wrote: > > > > > > > > > 2010/8/12 James Reeves <jree...@weavejester.com>: > > > > On 12 August 2010 14:33, limux <liumengji...@gmail.com> wrote: > > >> The solution inhttp://tiny.cc/3cmrxisuseful, 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