<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello VTK users,<br>
<br>
I'm upgrading from VTK 5.10.1 to VTK 6.1. All went smoothly until I
ran into an error rendering a vtkScalarBarActor whose title was set
to "J (A/m²)".<br>
<br>
This worked fine in 5.10.1, but in 6.1, the vtkutf8::is_valid()
method called from vtkUnicodeString::from_utf8() returns false
because the value of "²" is 0xB2 (in the extended ASCII range) but
the vtkutf8 code internally stops at 0x80 (sequence_length() in
core.h returns 0). That in turn causes a debug message
"vtkUnicodeString::from_utf8(): not a valid UTF-8 string." to appear
and then other problems with vtkTextActor not being able to
calculate its bounds
<title>Snippe"vtkUnicodeString::from_utf8(): not a valid UTF-8
string."</title>
and so on.<br>
<br>
If I force vtkutf8::is_valid() to return true in the debugger, it
all renders properly (like in 5.10.1).<br>
<br>
Note that according to
<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts">http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts</a>,
this is a valid character and has the same value in Unicode and
traditional ASCII for backwards compatibility (not that I'm a
Unicode or character encoding expert by any means).<br>
<br>
So my questions:<br>
<ol>
<li>How can I get the superscript 2, 3 and minus sign to display
with VTK 6.1? Has anybody done this?</li>
<li>I don't think that VTK 6.1 fully supports Unicode. Or maybe it
does and I'm doing something wrong?</li>
<li>What about the VTK 6.x nightlies? Would I be better off using
that?</li>
<li>I also notice that VTK is using utf8 version 2.1 (but modified
to be private to VTK) and the current release is 2.3.4. Would
upgrading the the newest of utf8 version help?</li>
</ol>
Thanks.
<title>Snippet</title>
<title>Snippet</title>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Signature</title>
<a href="http:://www.infolytica.com">www.infolytica.com </a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239
</div>
</body>
</html>