Yes but did you tried with "hé!"? :-)
I'm using Eclipse IDE or Notepad++. The last issue "Error in
processing html page" was because Eclipse defaults to cp1252 encoding
on Windows for saving files. I went Window->Preferences->General-
>Workspace menu to change the default to UTF-8, saved the files again
and the problem disappeared.
About this one, it looks I have to specify explicitly in the code the
encoding of HttpServletRequest else the platform default is used and
it seems it is not UTF-8 in my Windows machine. I don't know how to
change Windows default...
Now giving this a second thought, I checked the POST request sent by
Firefox with "Live HTTP headers" plugin and UTF-8 is specified via
this line:
Content-Type: text/html; charset=UTF-8
Now since the info is present in the request, how comes I have to set
the encoding manually in the code? I don't plan to support Chinese
content anytime soon but now I'm not sure this is the right way
anymore.
Thanks,
Sebastien
On Nov 13, 11:23 am, Tim Perrett <[EMAIL PROTECTED]> wrote:
> Out of interest, what text editor are you using? There are other guys
> using windows on this list and I'm pretty sure they have no problems.
>
> I've seen some problems with VS on windows, but there are plenty of x-
> platform editors which will work just fine - I rently did a small lift
> app in sweedish and had no problems :-)
>
> Cheers, Tim
>
> Sent from my iPhone
>
> On 13 Nov 2008, at 06:08, "Sebastien Bocq" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Yes, it works. I didn't found any way to change the default encoding
> > to UTF-8 on Windows, all I found is that it is possible to set the
> > encoding Java uses via the command line by specifying
> > -Dfile.encoding=UTF8. I'll set it manually in the code like you
> > showed, it is the most practical approach.
>
> > Thanks!
> > Sebastien
>
> >> Try this... In Boot.scala, add the following line to the boot method:
>
> >> LiftRules.appendEarly(makeUtf8)
>
> >> And the following method to the Boot class:
> >> private def makeUtf8(req: HttpServletRequest): Unit =
> >> {req.setCharacterEncoding("UTF-8")}
>
> >> That will force the character encoding to be UTF-8 rather than
> >> whatever the
> >> platform coding is.
>
> >> On Wed, Nov 12, 2008 at 11:59 AM, Sebastien Bocq <[EMAIL PROTECTED]
>
> >> wrote:
>
> >>>> What browser are you using to test?
>
> >>> Firefox (UTF-8 turned on)
>
> >>>> What container is your app running in?
>
> >>> Jetty (started with mvn jetty:run)
>
> >>>> What OS is your app running on?
>
> >>> Windows XP (French)
>
> >>>> On Wed, Nov 12, 2008 at 8:13 AM, sbocq <[EMAIL PROTECTED]>
> >>>> wrote:
>
> >>>>> Hello,
>
> >>>>> I'm facing another UTF-8 encoding issue. When I submit text with
> >>>>> accented characters in a text field from the browser, the encoding
> >>>>> gets lost somewhere on its way to the RequestVar. I'm using the
> >>>>> code
> >>>>> snippet below that writes back the list of messages submitted. For
> >>>>> example, when I type "hé!" in the "Update" submit form, I ge
> >>>>> t back
> >>>>> "#é# hÃ(c)!" in the browser.
>
> >>>>> class Update {
> >>>>> object qpx extends RequestVar(Full("")) // default is empty string
>
> >>>>> def show(xhtml: NodeSeq): NodeSeq = {
> >>>>> val msgSent = !(qpx.isEmpty || qpx.open_!.length == 0)
> >>>>> if (msgSent){
> >>>>> val msg:Message = Message.create
> >>>>> msg.text(qpx.open_!).save
> >>>>> }
> >>>>> val messages = Message.findAll
> >>>>> val temp = messages.foldLeft(""){(str, msg) => str + " #é# " +
> >>>>> msg.text}
>
> >>>>> bind("qp", xhtml,
> >>>>> "update" --> text("", v => qpx(Full(v))) % ("size" ->
> >>>>> "10")
> >>>>> % ("id" -> "update"),
> >>>>> "submit" --> submit(?("Update"), ignore => {}),
> >>>>> "messages" --> <div>{temp}</div>
> >>>>> )
> >>>>> }
> >>>>> }
>
> >>>>> <lift:surround with="default" at="content">
> >>>>> <div class="heading" id="title">¿Qué pasa?</div>
> >>>>> <lift:Update.show form="POST">
> >>>>> <label for="update">What's going on? </label>
> >>>>> <qp:update/>
> >>>>> <qp:submit/>
> >>>>> <qp:messages/>
> >>>>> </lift:Update.show>
> >>>>> </lift:surround>
>
> >>>>> Thanks,
> >>>>> Sebastien
>
> >>>> --
> >>>> Lift, the simply functional web frameworkhttp://liftweb.net
> >>>> Collaborative Task Managementhttp://much4.us
> >>>> Follow me:http://twitter.com/dpp
> >>>> Git some:http://github.com/dpp
>
> >> --
> >> Lift, the simply functional web frameworkhttp://liftweb.net
> >> Collaborative Task Managementhttp://much4.us
> >> Follow me:http://twitter.com/dpp
> >> Git some:http://github.com/dpp
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---