The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
XmlReporter encoding problem

2 replies on 1 page. Most recent reply: Jan 25, 2011 3:51 PM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Damian Golda

Posts: 1
Nickname: dgolda
Registered: Dec, 2010

XmlReporter encoding problem Posted: Dec 15, 2010 9:32 AM
Reply to this message Reply
Advertisement
XmlReporter creates XML files declared as UTF-8:
line 290:

"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + withCDATA

but writes characters using default system encoding (in my case CP1250).

So I've got:
"Invalid byte 1 of 1-byte UTF-8 sequence" while parsing xmls.

I suppose, the reason is in line 73:

val out = new PrintWriter(filespec)

According to JavaDoc of PrintWriter:
"which will encode characters using the default charset"

So I suggest it should be:

val out = new PrintWriter(filespec, "UTF-8")

--
Damian


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: XmlReporter encoding problem Posted: Dec 15, 2010 9:32 PM
Reply to this message Reply
Hi Damian,

I'll add this to our do list.

Thanks for the suggestion.

Bill

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: XmlReporter encoding problem Posted: Jan 25, 2011 3:51 PM
Reply to this message Reply
Hi Damian,

This is now fixed in 1.3-SNAPSHOT:

http://scala-tools.org/repo-snapshots/org/scalatest/scalatest/1.3-SNAPSHOT/

If you get a chance, please try this out and verify the fix works for you. Post your results here or to the scalatest-users mailing list.

Thanks.

Bill

Flat View: This topic has 2 replies on 1 page
Topic: MustMatchers is not included into scalatest-1.2.1-SNAPSHOT Previous Topic   Next Topic Topic: strange execution order in WordSpec test

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use