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 get 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 framework http://liftweb.net
>> > Collaborative Task Management http://much4.us
>> > Follow me: http://twitter.com/dpp
>> > Git some: http://github.com/dpp
>> >
>> > >
>> >
>>
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to