[vtkusers] Can VTK be built for UNICODE in visual studio 2013 C++?

David Gobbi david.gobbi at gmail.com
Sun Jun 7 15:59:58 EDT 2015


In general, no.  To be more specific:

1) The vtk examples all use "main" instead of "wmain", therefore the
program arguments use the Windows 8-bit codepage rather than unicode.

2) When VTK does system calls (opening/closing files etc) it does one of
three things, depending on exactly what VTK class is using the file:
a) some classes use the non-"wide" system calls, i.e. 8-bit all the way
through
b) some classes use kwsys, which for the most part converts 8-bit strings
to Windows unicode and then calls the "wide" system methods
c) some classes open files with a third-party library, e.g.  libjpeg jpeg
files or libpng for png files, and I'm not sure what those third-party
libraries do under-the-hood.


I think it would be nice if VTK, as a rule, always used either utf-8
strings or vtkUnicodeString internally, and always used "wide" system calls
on Windows, with automatic conversion between utf-8 and Windows unicode
whenever necessary.  That's still a ways off, though.  It would be a
sizeable job for anyone to implement and test this.

 - David


On Sun, Jun 7, 2015 at 12:14 PM, Andy Chen <zchenandy at gmail.com> wrote:

> Hello,
>
> Can anyone please let me know the answer?  I mean compile and build as it
> is.
>
> Thanks for your help in advance.
>
> Andy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150607/f32e2709/attachment.html>


More information about the vtkusers mailing list