SBT Compile error - java.io.IOException: MALFORMED

2,147 views
Skip to first unread message

Santiago

unread,
Jul 1, 2011, 4:32:08 PM7/1/11
to Lift
Hi,

I have been getting the below error when compiling my project in SBT.
Reading from previous posts it looks like that this is a known bug for
the RuntimeException but I am getting an IOException.

I have tried the following:

clean
clean-lib
clean-cache

but I am still getting the below error on compile. Any ideas as to how
to resolve this?

[info] Building project Lift SBT Template 0.1 against Scala 2.8.1
[info] using LiftProject with sbt 0.7.5 and Scala 2.7.7

...
...
...

[info] Compiling main sources...
java.io.IOException: MALFORMED[1]
at scala.tools.nsc.io.SourceReader$.decode(SourceReader.scala:
137)
at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:91)
at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:46)
at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:65)
at scala.tools.nsc.Global.getSourceFile(Global.scala:232)
at scala.tools.nsc.Global.getSourceFile(Global.scala:238)
at scala.tools.nsc.Global$Run$$anonfun$6.apply(Global.scala:
820)
at scala.tools.nsc.Global$Run$$anonfun$6.apply(Global.scala:
820)

....
....

[error] IO error while decoding C:\LiftProject\src\main\scala
\code\snippet\Util.scala with UTF-8

Peter Brant

unread,
Jul 1, 2011, 4:38:03 PM7/1/11
to lif...@googlegroups.com
Based on the error message,
C:\LiftProject\src\main\scala\code\snippet\Util.scala is not valid
UTF-8. Doesn't Windows use Cp1252 by default? I wonder if some
non-ASCII character crept into Util.scala and your editor isn't using
UTF-8.

Pete

> --
> 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.
>
>

Santiago

unread,
Jul 2, 2011, 5:32:39 AM7/2/11
to Lift
Im using Eclipse as my editor. How can I check if a non-ASCII
character entered my scala file?

Its strange as I encountered the error after adding a simple variable
to Util.scala. I removed my changes and still got the error message.

S.

Andreas Joseph Krogh

unread,
Jul 2, 2011, 6:33:24 AM7/2/11
to lif...@googlegroups.com
On 07/02/2011 11:32 AM, Santiago wrote:
> Im using Eclipse as my editor. How can I check if a non-ASCII
> character entered my scala file?
>
> Its strange as I encountered the error after adding a simple variable
> to Util.scala. I removed my changes and still got the error message.
I'm sure you, being a Scala-programmer, are able to write a program to
test for non-ascii characters in a file.

Not being an Eclipse-user my self I can't tell how to do it in Eclipse,
but using grep this does what you want:

grep -P "[\x80-\xFF]" myFile

--
Andreas Joseph Krogh <and...@officenet.no>
Senior Software Developer / CTO
Public key: http://home.officenet.no/~andreak/public_key.asc
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Rosenholmveien 25 | know how to do a thing and to watch |
1414 Troll�sen | somebody else doing it wrong, without |
NORWAY | comment. |
Org.nr: NO 981 479 076 | |
| |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+

Santiago

unread,
Jul 2, 2011, 11:44:59 AM7/2/11
to Lift
finally found it - it was a double quote. I had a ” instead of "

On Jul 2, 11:33 am, Andreas Joseph Krogh <andreas.kr...@gmail.com>
wrote:
> On 07/02/2011 11:32 AM, Santiago wrote:> Im using Eclipse as my editor. How can I check if a non-ASCII
> > character entered my scala file?
>
> > Its strange as I encountered the error after adding a simple variable
> > to Util.scala. I removed my changes and still got the error message.
>
> I'm sure you, being a Scala-programmer, are able to write a program to
> test for non-ascii characters in a file.
>
> Not being an Eclipse-user my self I can't tell how to do it in Eclipse,
> but using grep this does what you want:
>
> grep -P "[\x80-\xFF]" myFile
>
> --
> Andreas Joseph Krogh <andr...@officenet.no>
Reply all
Reply to author
Forward
0 new messages