02-17-2021 04:21 AM
"Is name Multiplatform.vi" claims:
"This VI checks if a filename is valid on different platforms according to the following rules (Windows):
But in fact it also does not allow multibyte characters, which Windows has no issues with: "Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following /.../ "
Questions:
1. Why is it not described that only characters below 128 are allowed?
2. Why are they not allowed? They should be, at least for Windows.
I can create my own VI with the desired behavior, but if there is a reason for the choice, I would like an explanation and better documentation.
There is a comment on the diagram if a character is above 127. It mentions "big 5", so I assume that it is intended to stop e.g. some Chinese coded characters:
Is it that some encodings has multibyte characters already in the 127-255 range? I guess so. Maybe I answered nr 2 myself, but for "normal" encodings, we don't need that check. Maybe there should be an option for that check, like "check for multibyte characters".
Solved! Go to Solution.
02-17-2021 05:18 AM
02-17-2021 05:24 AM
02-17-2021 06:12 AM
I think you have the intent of the VI backwards. AND all the platforms, not OR them. This is supposed to tell you if your filename will work on ALL platforms, not ANY platform.
02-17-2021 08:07 AM
@billko wrote:
I think you have the intent of the VI backwards. AND all the platforms, not OR them. This is supposed to tell you if your filename will work on ALL platforms, not ANY platform.
By the name of the VI, one might think so, but there is an input "filename must be valid on all platforms (F)", so by default it should only care about the current platform. This is also in the VI description.
02-17-2021 09:30 AM
@thols wrote:
@billko wrote:
I think you have the intent of the VI backwards. AND all the platforms, not OR them. This is supposed to tell you if your filename will work on ALL platforms, not ANY platform.
By the name of the VI, one might think so, but there is an input "filename must be valid on all platforms (F)", so by default it should only care about the current platform. This is also in the VI description.
Wow! I did read the help, and I did remember that input, but I didn't realize its significance. Sorry about that.
02-17-2021 11:10 AM
We have a hidden gem for checking file names for multiplatform issues that allows multibyte characters:
[LabVIEW 20xx]\vi.lib\Utility\Multibyte\Is Name Multiplatform_Allow Multibyte.vi
We made it a separate VI because we didn't want to change the behavior of the non-multibyte VI given how widely it was used prior to identifying the need to support multibyte characters.
02-17-2021 01:35 PM
Thanks Darren. Good to know.
But I still think the documentation is incorrect since it says nothing about the fact that no character higher than 127 is allowed.
This filename is valid in Windows:
It may seem silly to use such characters in a filename, but some of those characters are pretty common in some not so small languages.
And if an improved version will ever be added then I think the reserved Windows file names should be checked too.
02-17-2021 02:22 PM
I have filed Bug 1325918 to update the documentation for Is Name Multiplatform VI to mention the multi-byte limitation, and also give the path to the hidden gem VI for users who need that functionality.