LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
GurraW

Make the string type contain subgroups for ASCII and UTF-16, UTF-16LE, UTF-8...

Status: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.

By the introduction Unicode support in Labview, keeping track of text coding can be a pain. 

Therefore, it would be great if with each string control, the coding was also included in the wire.

Unicode2.png

This would be much like the numeric controls which not only holds the values, but also the type. Further more, converter VIs could be introduced to cast between the different types.

 

3 Comments
tomasz.janicki.tj
Member
GregR
Active Participant

This problem isn't even limited to different string encodings because users also use strings to contain binary data. This means one of your string encodings should really be "I'm not a string at all".

 

If you've looked at the "Next Generation LabVIEW Features Technology Preview" you saw a different approach to this problem. Rather than having multiple types of strings, all strings are UTF8 text. This avoids having to modify all our diagram nodes to account for multiple encodings. As long as the string stays within the diagram there is never a need to use any other encoding. It is only when the data leaves the diagram that support for other encodings becomes important. In those cases we can support specifying an encoding. When you write text to a file we would default to UTF8 but allow you to choose something else. The same would be true for calling DLLs or network operations.

 

Beyond just saying strings are UTF8 encoded, we are also saying that all string data must be valid UTF8 text. This is because our user interface may actually use a different Unicode encoding. Translating between Unicode encodings is not safe for strings that contain invalid sequences. This means we will no longer support using the string data type to hold binary data. Binary data must use U8 arrays. As part of this we would develop a new control capable of displaying U8 arrays in a way similar to the current hex display format of the string control.

 

We would also support nodes to convert string data to or from a specific encoding on the diagram. These nodes would always convert to or from U8 array. This would allow more complex interop situations to be handled.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.