please add support for unicode filenames

Ideas for improvements and requests for new features in XnView Classic

Moderators: XnTriq, xnview

Post Reply
tuitfun
Posts: 1
Joined: Wed Sep 12, 2007 3:11 pm

please add support for unicode filenames

Post by tuitfun » Wed Sep 12, 2007 3:21 pm

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

Conqueror
Posts: 11
Joined: Mon Dec 07, 2009 5:03 am

Re: please add support for unicode filenames

Post by Conqueror » Tue May 24, 2011 5:03 am

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.

User avatar
xnview
Author of XnView
Posts: 33617
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: please add support for unicode filenames

Post by xnview » Tue May 24, 2011 6:58 am

XnViewMP has native UNICODE support...
Pierre.

Conqueror
Posts: 11
Joined: Mon Dec 07, 2009 5:03 am

Re: please add support for unicode filenames

Post by Conqueror » Tue May 24, 2011 3:18 pm

Thanks. I'll try it.

User avatar
V@no
Posts: 32
Joined: Sun Feb 25, 2007 8:06 pm

Re: please add support for unicode filenames

Post by V@no » Mon Jul 04, 2011 11:12 pm

xnview wrote:XnViewMP has native UNICODE support...
And it has 1/100 of XnView features...tough choice.

User avatar
xnview
Author of XnView
Posts: 33617
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: please add support for unicode filenames

Post by xnview » Tue Jul 05, 2011 3:39 pm

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...
Pierre.

User avatar
d03g03l
Posts: 7
Joined: Wed Apr 27, 2011 5:46 am
Contact:

Re: please add support for unicode filenames

Post by d03g03l » Thu Jul 07, 2011 11:33 am

if so, can u open this files? :(
:| :bug:
Attachments
CanUOpenThis¿.zip
Download, Extract n open with Xnview...
(157.16 KiB) Downloaded 94 times

User avatar
xnview
Author of XnView
Posts: 33617
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: please add support for unicode filenames

Post by xnview » Sun Jul 10, 2011 7:28 pm

d03g03l wrote:if so, can u open this files? :(
:| :bug:
With XnViewMP?
Pierre.

Post Reply