-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when writing text with special character #132
Comments
Thanks Olivier - one of those simple things that are so complicated! I'll take a look at what I can do to support the extended ASCII tables. You probably have more experience with this than myself so any hints? I presume LabVIEW just uses the active code page in Windows? |
I didn't dive into the code to see where the issue was. So, I haven't ideas how to fix it properly. |
Ah no worries, wasn't sure if it is something you might have come across elsewhere. Turns out extended ASCII like LabVIEW is a minefield for compatibility We can definitely make it robust to this as you say. There are 3 options to consider:
I'm inclined towards 2 although sounds like the tools provided just wrap the Windows API so perhaps should be 3 and we can use them to ensure we are calling the correct methods. |
I'm not sure 2 will work. If I remember, that was the first thing I tried, and it was unsuccessful. |
I'll have a play - I've just looked in the NI Unicode tools and there is a wrapper for a private primitive which is text to UTF-8 and appears to be cross-platform. Sounds like what we would need but perhaps there are limitations? Alternatively I can copy their method for ASCII to UTF-16 using Windows calls at least - I can see the correct options now and wrap then on the Rust side where there are easier conversions from UTF-16 to UTF-8 (the internal representation required) |
Nice. If you want me to test something, just let me know. |
Added UTF8 conversions at LabVIEW boundaries so all data on the wire is UTF8 for the proxy. Additional test file shows the impact of non-ascii in filename which still requires a fix and so is commented out of the integration tests. for #132
The next release should fix these issues. Hopefully, it will appear on Github today! |
Just to handle another case raised in #132 non-ascii is valid in filename but affects matches. This replaces them in the service name by underscores. NOTE: This does risk a name collision but the risks of this seem very low.
Excellent! Thanks for this @JamesMc86 👏 |
G-CLI version 3.0.0 beta1
I have the following error when writing a text with a special character with the
Write String
function:Comms Error: Message contents cannot be read as UTF8
It would be nice to find a fix when the string you want to write is not a constant (file path, for example).
NOTE: I already implemented a quick and dirty workaround—no emergency to implement a fix for me.
For the record, here is my fix
The text was updated successfully, but these errors were encountered: