0

I'm trying Batik's rasterizer and everything is working fine. This is the Java line I'm running to convert the svg to a png :

java -jar batik-rasterizer.jar -m image/png samples/barChart.svg

And this is the content of the SVG file

http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk/samples/barChart.svg

But if I change the content of the svg (the bar label) from "Shoe" to "ShoÉ". It fails with this message

org.apache.batik.transcoder.TranscoderException: null Invalid byte 2 of 2-byte UTF-8 sequence

Now, I know I can simply use the unicode equivalent and it will work. But I'm looking for a solution similar to the html version of adding the line below.

<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

I also tried adding the next line before and after the "!DOCTYPE svg..." but i still get the same error.

<?xml version="1.0" encoding="UTF-8" ?>

Any suggestions would be appreciated.

LatinCanuck
  • 454
  • 2
  • 10
  • 29
  • 1
    Are you sure you are looking to this from the right angle? Your "É" character, Unicode 0x00CA, may be getting recognized as the first of an UTF8 sequence; then, whatever follows is the 2nd code. Could it be your text editor did not save the character properly as UTF8 -- 0xC3, 0x8A? (You might need a hex editor to find out.) – Jongware Nov 28 '13 at 21:21
  • @Jongware You are absolutely right. The issue was the text editor (Notepad++). It was displaying É correctly but saving it incorrectly. Thanks for your help. – LatinCanuck Nov 28 '13 at 21:40

0 Answers0