Error opening a file with path containing UTF-8 characters (and workaround)

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, helmut, xnview

bipbip
Posts: 2
Joined: Sat Oct 08, 2022 5:37 pm

Error opening a file with path containing UTF-8 characters (and workaround)

Post by bipbip »

XnView Classic: 2.51.1 - 64 bit
OS: Windows 10 64bit

How to reproduce
- Create a folder containing UTF8 characters and put an image in it. (example: "C:\TEST\背\myimage.png"
- Double click on it in the windows explorer to open the image.
- You get an error popup. (see attachment)

Expected behavior
It opens the image in Xnview.

Workaround
- This application does not support UTF-8 but you can still access UTF-8 paths inside the application because it use the short paths.
- The argument provided in "HKEY_CLASSES_ROOT\XnView.ext\shell\open\command" might containing UTF-8 characters.
- I made an application to convert those arguments to short paths and forward them to xnview here: https://github.com/d3xMachina/LTSPath


Would it be possible to support UTF-8 only for the argument parsing in Xnview and call GetShortPathNameW() to get the short path like I did or would it be too much work ? Thanks.
You do not have the required permissions to view the files attached to this post.