LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Unicode, Boolean Text vs Boolean Caption


@rolfk wrote:

You are aware that the IsTextUnicode() API is badly broken since ever? It will return bad status with certain patterns of text..


Yeah, the context help for the encoding detection VI states it isn't perfect and will fail on certain byte orders. I'll probably replace it with a more heavy weight encoding detection like uchardet in a future version.

0 Kudos
Message 11 of 24
(1,104 Views)

Thanks again.
Here are additional information. In the attached files one sees that the “č” character (\10D) creates a New Line. Actually without using the ‘Convert EOL’, the resulting string is well displayed. But since I have to pinpoint to the correct {line,column} element of the resulting table (convert String to Array of Strings detects too many \n) I miss the target 😉 The other possibility would be not to use the Array of Strings conversion but to count the \t…

0 Kudos
Message 12 of 24
(1,098 Views)

You can specify a multi-byte string as the delimiter input to Spreadsheet String To Array. This example matches UTF-16LE encoding of "\r\n", and splits into a 1D array:

Dataflow_G_0-1692779650772.png

 

0 Kudos
Message 13 of 24
(1,079 Views)

Yes I know that different delimiters can be configured but in the case that I presented above it is right in the middle of a string that some strange characters like “č” ‘breaks’ the string and generates a new line that should never exist. And whatever the delimiter used it creates a 2D String array that is unusable to retrieve specific {line,column} elements...

0 Kudos
Message 14 of 24
(1,071 Views)

In this case the string will need to be split on the UTF-16LE line endings first (because Spreadsheet String To Array isn't Unicode aware), and then split again on the UTF-16LE tab delimiter.

Dataflow_G_0-1692783246771.png

 

 

0 Kudos
Message 15 of 24
(1,063 Views)

Try to run your code with some “č” in your strings...

On my side the original problem is still there...

0 Kudos
Message 16 of 24
(1,060 Views)

Adding some random "č" chars works properly, so not sure what's going on. Does running the attached VI with your unicode string work? Can you share the text file you're using?

 

Dataflow_G_0-1692785027711.png

 

Message 17 of 24
(1,049 Views)

Your example works well. 

Mine does not.

I am attaching my Unicode file...

0 Kudos
Message 18 of 24
(1,042 Views)

I just had a thought - you might be running into a Unicode issue specific to LV2022 Q3 similar to the one in this thread. I'll try out your text file in LV2022 Q3 or newer and report back.

0 Kudos
Message 19 of 24
(1,033 Views)

In the meantime I have built the attached patch that seems to work. At least in my situation. 

It shows that "element from 2D" does not work correctly whereas "element from 1D" does the job. In other words the "Reshape Array" function also creates an issue in the further management of Unicode...

0 Kudos
Message 20 of 24
(1,015 Views)