Page 1 of 1

please add support for unicode filenames

Posted: Wed Sep 12, 2007 3:21 pm
by tuitfun
Hello,

XnView is now ignoring all files and directories whose names have unicode characters, e.g. 你好世界. Please add support for unicode filenames.

There're two problems in windows with unicode filenames. The first one is that the regular c functions, e.g. open() stat(), do not work if the filename has unicode characters, e.g. 你好世界. We need to use the wide character functions instead, e.g. _wopen(), _wstat().

In mingw (or similarly in MSVC), a header file, tchar.h, exists to make it easier to work in both unicode & non-unicode systems. basically tchar.h has something like:
#ifdef _UNICODE
typedef wchar_t TCHAR;
#define _topen _wopen
#define _tstat _wstat
#else
typedef char TCHAR;
#define _topen open
#define _tstat _stat
#endif
So, if we use TCHAR instead of char, and _topen() instead of open(), it'll get mapped correctly depending on whether _UNICODE is defined. Note that some microsoft functions check for UNICODE not _UNICODE, so we'll need to define both. For more information about this, please see http://sourceforge.net/mailarchive/mess ... .yahoo.com particularly the replies from Tor Lillqvist.

The second problem is that the command line arguments in main() (*argv[]) would get encoded incorrectly if unicode arguments are used. We can use __wgetmainargs() to get the wide character arguments instead.

Once we have the wide character strings, we convert them to utf-8 so we can pass them around in functions which expect char *; and we convert them back to wide char strings just before calling the _wopen(). For more information, please see http://sourceforge.net/mailarchive/mess ... .yahoo.com

tuit

Re: please add support for unicode filenames

Posted: Tue May 24, 2011 5:03 am
by Conqueror
After 4 years, this request has still not been fulfilled. XnView is very limited to western languages only. No support for Eastern languages?
I'm using English version of windows 7 64 bit, but can't open files which have unicode characters in it's path.

Re: please add support for unicode filenames

Posted: Tue May 24, 2011 6:58 am
by xnview
XnViewMP has native UNICODE support...

Re: please add support for unicode filenames

Posted: Tue May 24, 2011 3:18 pm
by Conqueror
Thanks. I'll try it.

Re: please add support for unicode filenames

Posted: Mon Jul 04, 2011 11:12 pm
by V@no
xnview wrote:XnViewMP has native UNICODE support...
And it has 1/100 of XnView features...tough choice.

Re: please add support for unicode filenames

Posted: Tue Jul 05, 2011 3:39 pm
by xnview
V@no wrote:
xnview wrote:XnViewMP has native UNICODE support...
And it has 1/100 of XnView features...tough choice.
No almost 50%, new version will be available soon...

Re: please add support for unicode filenames

Posted: Thu Jul 07, 2011 11:33 am
by d03g03l
if so, can u open this files? :(
:| :bug:

Re: please add support for unicode filenames

Posted: Sun Jul 10, 2011 7:28 pm
by xnview
d03g03l wrote:if so, can u open this files? :(
:| :bug:
With XnViewMP?