I managed to merge pom.xml and some codes on Boot.scala, and succeeded
to build my application, but when I access to it from browser, it
displays:
Message: java.nio.charset.UnmappableCharacterException: Input length =
2
java.nio.charset.CoderResult.throwException(CoderResult.java:261)
sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:319)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
java.io.InputStreamReader.read(InputStreamReader.java:167)
java.io.BufferedReader.fill(BufferedReader.java:136)
java.io.BufferedReader.read(BufferedReader.java:157)
scala.io.BufferedSource$$anonfun$1$$anonfun$apply$1.apply
(BufferedSource.scala:29)
scala.io.BufferedSource$$anonfun$1$$anonfun$apply$1.apply
(BufferedSource.scala:29)
scala.io.Codec.wrap(Codec.scala:65)
scala.io.BufferedSource$$anonfun$1.apply(BufferedSource.scala:29)
scala.io.BufferedSource$$anonfun$1.apply(BufferedSource.scala:29)
scala.collection.Iterator$$anon$13.next(Iterator.scala:145)
scala.collection.Iterator$$anon$24.hasNext(Iterator.scala:435)
scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:326)
scala.io.Source.hasNext(Source.scala:209)
net.liftweb.util.PCDataXmlParser$$anonfun$apply$2$$anonfun$apply
$4.apply(PCDataMarkupParser.scala:184)
... and more
I traced Lift source and found out that "Codec" argument is not
passed to Source.fromInputStream(in) at PCDataMarkupParser.scala(l.
182). "Codec" api seems to be introduced newly in Scala 2.8, and
Source.fromInputStream() uses Codec.default as a implicit argument.
My problem here, is I'm using utf-8 for write *.html templates, but
my Codec.default is "MS932"(Japanese characterset in Windows), so
failing to decode my template files. I looked through Scala lib
source, and found out Codec.default it is actually an alias to
java.lang.Charset.getDefault(), so I just set -Djava.encoding=utf-8 to
MVN_OPTS and solved the problem, but considering deployment, I don't
think it's a smart way.
BTW, I confirmed this does not occur on Lift2.0-scala2.7.7. I think
default source encoding should be somehow configurable in Lift to
achieve portability.
Kind regards,
Pomu TAKEUCHI
Cheers, Tim
> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>
Pomu TAKEUCHI
2010/2/3 Timothy Perrett <tim...@getintheloop.eu>:
Do not use the 2.8 port of Lift yet... its mostly broken. Please use 2.7.7 until the official 2.8 release is out.
Can you please set project.build.sourceEncoding=UTF-8 in your pom.xml
and check if it works?
You can set project.build.sourceEncoding in pom.xml the following way:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
...
...
</properties>
Cheers, Indrajit
> <mailto:lif...@googlegroups.com>.
> > To unsubscribe from this group, send email to
> liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com
> <mailto:lif...@googlegroups.com>.
> To unsubscribe from this group, send email to
> liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
Thanks for the advise. I already tried that, but not worked on *.html
templates. Exception occurs at runtime, not at build.
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Regards,
Pomu TAKEUCHI
2010/2/4 Indrajit Raychaudhuri <indr...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
On Wed, Feb 3, 2010 at 11:00 AM, pomu0325 <pomu...@gmail.com> wrote:
> Hi, I'm quite a newbie to Lift. I'm now trying to port my first Lift
> application from Lift1.0.2 to latest Lift2.0-scala280, and faced a
> problem relating to source encoding.
...
> My problem here, is I'm using utf-8 for write *.html templates, but
> my Codec.default is "MS932"(Japanese characterset in Windows), so
> failing to decode my template files. I looked through Scala lib
> source, and found out Codec.default it is actually an alias to
> java.lang.Charset.getDefault(), so I just set -Djava.encoding=utf-8 to
> MVN_OPTS and solved the problem, but considering deployment, I don't
> think it's a smart way.
FYI, the reported problem was fixed at last night, thanks to hseeberger,
as follows,
http://www.assembla.com/spaces/liftweb/tickets/364
http://github.com/dpp/liftweb/commit/4bfe8579c5283642c9c059b55f98236155f2d423
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: @ymnk