Page 1 of 1

Unicode names

Posted: Tue Jun 27, 2006 3:50 pm
by Alessandro
Hi,

looks like in gflib and xnview char* filenames were used in place of tchar so people which uses unicode characters like in japan or china can't view their images...
am I wrong?

Best regards

Re: Unicode names

Posted: Tue Jun 27, 2006 7:50 pm
by xnview
Alessandro wrote:Hi,

looks like in gflib and xnview char* filenames were used in place of tchar so people which uses unicode characters like in japan or china can't view their images...
am I wrong?
Yes, i use char* but you can convert UNICODE to multibyte

Re: Unicode names

Posted: Tue Aug 01, 2006 4:35 am
by MaierMan
xnview wrote:Yes, i use char* but you can convert UNICODE to multibyte
You can't actually.
Works if the filename only contains char representable by the system locale.
But won't work with "real" WideChar filenames.
E.g. I won't be able to open files with arab chars in the name under my de-DE Windows ;)

Workaround is to use gflLoad*FromHandle + Callbacks + CreateFileW (under Windows)

There should be a "Windows only" set of wchar_t* enabled functions.
(*nix doesn't really support WideChar filenames FWIK, instead it will use UTF-8 encoded char*, if at all...)

Posted: Sun Aug 06, 2006 6:03 pm
by Alessandro
actually I think I can also use _wfopen for this purpose, tough I couldn't get a valid FILE * value yet.
Except this I also wonder what the result values should be... GFL_ERROR & GFL_NO_ERROR in read and seek callbacks, and the position in tell? and are those 3 function enough to make gfllib work only to read files or should I define a wrapper for write too?
how bothersome... :(

Posted: Sun Aug 06, 2006 6:18 pm
by MaierMan
I have a small unicode layer built into gflW, the C++ Wrapper, that demonstrates the use of callbacks.
It's not really good, but it does it job.
Maybe you can get some ideas from it ;)

http://celebnamer.celebworld.ws/stuff/libgflW/

Posted: Tue Aug 08, 2006 7:45 pm
by Guest
Thanks, that helped with callbacks, unfortunately I discoverd that Builder is a nightmare to write unicode code, but that's a different story...

Thanks again!