Can't open file if non-ASCII characters present in path name

Hello everyone,

Just as the title says, I just found out that ParaView can’t open files whose path contains non-ASCII characters (a simple “é” will do).

My ParaView version: 5.10.1-MPI-Windows-Python3.9-msvc2017-AMD64

Output message:

critical: In unknown, line 0
critical: Cannot open data file " “D:\�.vtu” "

(the actual file name is “é.vtu”)

Steps to reproduce: insert a non-ASCII character in the file name of a VTK file, or put a VTK file with no non-ASCII characters in its name inside a folder with non-ASCII characters in its name, then try to open it.

I don’t mean to rant, but seriously, I thought we were over this in 2022 and unicode was the norm (the default even) nowadays. :expressionless:

HI @ragdollfun ,

We support unicode (or at least try to)

@todoooo may be able to help.

This is weird then.

Maybe this issue is related to Windows somewhat ? I know that Windows uses UTF-16 internally, instead of the more common UTF-8. Maybe that’s where the problem originates ? If ParaView assumes a UTF-8 encoding, it might explain why “é” appears as “�” in the error output message.

VTK and Paraview support UTF-8. On Windows UTF-16 text is converted before being passed to VTK (or it should be).

Are you sure you pasted a unicode character into your file name and not an extended character specific to your current code-page? Can you see the folder name inside Paraview?

1 Like

I didn’t “paste” the “é” character, it’s directly available on my French keyboard. I’m not sure what you mean by “an extended character specific to your current code-page”, but all the non-ASCII characters mentioned above have been manually typed (as opposed to generated by another software).

That said, I just tested opening the file from the file explorer embedded in ParaView and, strangely enough, I have no issues opening the same file. :rofl:

So to recapitulate:

  • double clicking on the aforementioned VTU file in the Windows explorer when the file path contains a non-ASCII character results in an error;
  • opening ParaView first, then using File → Open… (or Ctrl+O) and navigating to the same file (with the same path containing a non-ASCII character) works just fine.

How did you tell windows to open this file with ParaView ? Afaik, there is no shell extension in ParaView installation to handle that for you.

There’s a huge language barrier here between us, because I have no idea what you mean by that.

That’s very easy:

  1. Right-click on a file with the file extension of interest (for example “blahblahblah.vtp”), then choose “Properties” and a window will open;
  2. In this window, navigate to the “General” tab if it didn’t open there by default. The “Opens with:” field tells you what application is associated to this file extension and you can click on the “Change…” button on the right to change this;
  3. Clicking on “Change…” opens a dialog box with suggested applications and you can click on “More apps” for even more suggestions;
  4. If you do not find the application you are looking for in this list, you can click on “Look for another app on this PC” on the bottom of this list to open up the Windows file explorer in order to manually select the application’s executable;
  5. For ParaView, the default location is something like “C:\Program Files\ParaView 5.10.1-MPI-Windows-Python3.9-msvc2017-AMD64\bin\paraview.exe” depending on your version;
  6. After selecting the ParaView executable and clicking on “Open”, you are back to the “Parameters” dialog window mentioned in steps (1) and (2). You can close it and all files with the same extension (.vtp in the present example) will now prompt Windows to open ParaView when you double-click on them.

Right, then it looks like there is a Unicode conversion missing in the command line attributes parsing, wdyt @todoooo ?

Yes. It sounds like a conversion error in the shell extension for Windows explorer. It wasn’t a use case I considered.

Which means there’s an unhandled entry point to Paraview file opening. At least you have a work-around.

@ragdollfun You can also drag files from Windows explorer into the pipeline browser panel in Paraview.