Re: chinese character in hiccup

2010-08-13 Thread Steve Purcell
On 13 Aug 2010, at 11:40, James Reeves wrote: > I think it would be worth adding some charset setting middleware to > Ring, though, and perhaps document this behaviour. +1 -- character encoding is exactly the kind of thing one would want to set up application-wide. -Steve -- You received thi

Re: chinese character in hiccup

2010-08-13 Thread limux
You are right that there should be such a middleware in Ring. On 8月13日, 下午6时40分, James Reeves wrote: > 2010/8/13 limux : > > > Then, if Ring doesn't care of the charset also, there is no one, suck > > as jetty, ring, compojure would take care of the charset except > > myself. There are many peopo

Re: chinese character in hiccup

2010-08-13 Thread James Reeves
2010/8/13 limux : > Then, if Ring doesn't care of the charset also, there is no one, suck > as jetty, ring, compojure would take care of the charset except > myself. There are many peopole come from all kinds of country or > region who use ring, jetty and compojure. Let themselves set the right > c

Re: chinese character in hiccup

2010-08-13 Thread limux
One word, Why we would let Jetty set default charset to iso-8859-1, Why not Compojure can set the default charset to utf-8? Isn't utf8 a better choice? Is iso-8859 better than utf-8? On 8月13日, 下午5时05分, ngocdaothanh wrote: > > Perhaps Jetty add a charset of iso-8859-1 if there isn't one in respons

Re: chinese character in hiccup

2010-08-13 Thread limux
Then, if Ring doesn't care of the charset also, there is no one, suck as jetty, ring, compojure would take care of the charset except myself. There are many peopole come from all kinds of country or region who use ring, jetty and compojure. Let themselves set the right charset manually by wrap? I d

Re: chinese character in hiccup

2010-08-13 Thread ngocdaothanh
> Perhaps Jetty add a charset of iso-8859-1 if there isn't one in response I think this behavior is specified in the servlet spec: "If no charset is specified, ISO-8859-1 will be used" http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/Ser

Re: chinese character in hiccup

2010-08-12 Thread limux
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

Re: chinese character in hiccup

2010-08-12 Thread limux
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! Ma

Re: chinese character in hiccup

2010-08-12 Thread Rasmus Svensson
2010/8/12 James Reeves : > On 12 August 2010 14:33, limux 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 set

Re: chinese character in hiccup

2010-08-12 Thread James Reeves
On 12 August 2010 14:33, limux 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

Re: chinese character in hiccup

2010-08-12 Thread limux
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. On 8月11日, 下午2时41分, Nebojsa Stricevic wrote: > Hi, > > This looks similar like problem that I had with Clojure + Compojure + > Enlive

Re: chinese character in hiccup

2010-08-10 Thread Nebojsa Stricevic
Hi, This looks similar like problem that I had with Clojure + Compojure + Enlive and Serbian characters. I'm not sure if this is true, but maybe solution to my problem can be helpful. Read this mailing list thread: http://tiny.cc/3cmrx Greets, -- Nebojša Stričević -- You received this message

Re: chinese character in hiccup

2010-08-10 Thread Joop Kiefte
What do you get if you use the meta-line with GBK encoding? if that gives the right output, it is an input problem (i.e. the input is not UTF-8). 2010/8/10 Rasmus Svensson : > 2010/8/10 limux : >> There is some chinese chararters in the tables. I want to display them >> by hiccup, but browser disp

Re: chinese character in hiccup

2010-08-10 Thread Rasmus Svensson
I looked into the source of hiccup and tried entering the string "刘孟江" at various places, but I couldn't reproduce the error or find any code that did any form of encoding. When playing around with the repl, I was reminded that JLine (used by lein repl) does not support multibyte encodings (includ

Re: chinese character in hiccup

2010-08-10 Thread Rasmus Svensson
2010/8/10 limux : > There is some chinese chararters in the tables. I want to display them > by hiccup, but browser display those chinese character as ???. I spoke to him on #clojure and from what I could tell from some experiments I asked him to run: (map int "刘孟江") -> (21016 23391 27743) =>

Re: chinese character in hiccup

2010-08-10 Thread Joop Kiefte
Try using [:meta {:http-equiv "Content-Type" :content "text/html; charset=utf-8"}] inside your [:head] (can this be done with Jetty?) 2010/8/10 limux : > hi! > > I am doing a real-file demo with ring, compojure, hiccup, and database > access as well. > There is some chinese chararters in the tabl

chinese character in hiccup

2010-08-10 Thread limux
hi! I am doing a real-file demo with ring, compojure, hiccup, and database access as well. There is some chinese chararters in the tables. I want to display them by hiccup, but browser display those chinese character as ???. But the prn to console is ok. I am confused since I was a newbie in Cloju