XnView and DOS 8.3 names

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, xnview

Post Reply
Posts: 21
Joined: Thu Aug 06, 2015 5:39 pm

XnView and DOS 8.3 names

Post by uRsti11anError » Sat Aug 22, 2015 1:51 am

I know XnView classic does not support Unicode in filenames (or at least doesn't support characters from foreign locales) and I'm not going to demand it. I know as well XnViewMP can do that, but my need for viewing such files is very rare and often they just can be renamed for doing this in classic version. The following is not direct suggestion, but rather a curiosity.

I just want to ask if XnView classic could potentially make some more use of one trick than it does now.
- any graphic file XnView can open;
- access to Unicode font which not belongs to your locale;
- Windows console cmd.exe.
I took from wiki page for Norwegian alphabet letter "ø" and renamed one .bmp file on disk L:\ to "ø.bmp". As expected, XnView reported an error on attempt of opening it.
Next I have opened cmd on L:\ and issued command "dir /x *.bmp". That gave me short DOS-alike name in 8.3 format for this file.
In my case it was "24FD~1.BMP", though files with the same name and different extensions get different name part.
Then I have started XnView, menu File->Open, typed full path in DOS-style "L:\24FD~1.BMP" in filename field, clicked Open and landed in HEX viewer mode. Why XnView ever has it, you can't edit file and font is too small. But contents of file were correct.
If you do the same with file which does not contain foreign characters in its name (i.e. convert to DOS 8.3 and feed this way to XnView), then XnView opens it in Viewer mode.

So, can anything be done to have something more from ability to read Unicode named files with HEX viewer?
Like button "show as image" in HEX Viewer, or "Copy to temporary memory block and open", or hardcore "DOS 8.3" mode for XnView Browser, or menu "File->Open using DOS names"?

This method works with XVI32 HEX Editor. It can not open Unicode named files, but can access them and correctly save changes if path is given in DOS-style. Of course, XnView is more complicated software.

P.S. With HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation not set to 0 in registry all this idea goes kaput.

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

Re: XnView and DOS 8.3 names

Post by xnview » Sun Aug 23, 2015 3:13 pm

yes an idea, but user that open ø.bmp will be very surprised if the name becomes 24FD~1 :)

Posts: 21
Joined: Thu Aug 06, 2015 5:39 pm

Re: XnView and DOS 8.3 names

Post by uRsti11anError » Wed Aug 26, 2015 11:33 pm

Let's hope user who open ø.bmp in XnView is working in Norwegian/Danish locale and will succeed.

But for me personally this idea was so attractive that I with my limited programming experience and with help of World Wide Library have adapted this example to shell extension which allows to copy short DOS name of selected file to clipboard (just couldn't find such extension ready-to-use, others I know copy filename, URL but not DOS). Compiled in VS6 on Win2k, tested this .dll on XP as well. With little adventures project was converted to VS 2010 on Win7 x64, compiled and tested there too.
Ultimate Paint (an old image editor) which doesn't understand Unicode can successfully open .bmp from the path of maximal length consisting mostly of kanji when given short DOS name.

Could you please not dump valid image data into HEX viewer if XnView can't display preview in "Open picture" window but send them to decoder? Or at least add checkbox "try to open in Viewer anyway" if file looks doubtful? "Open picture" shows more files than XnView Browser if some of them include Unicode characters (kanji in XnView Browser is replaced with ??, while in Open dialog they look fine), so it would be possible to right-click such file and copypaste DOS name straight to filename field. If in XnView Browser is enabled filtering by graphics file type then Unicode named files are not displayed at all.
I'm not trying to be annoying (that's probably my natural quality), but does XnView Classic have some nuance in its architecture which obstructs sending data to somewhere else than HEX viewer?

Post Reply