Giter Club home page Giter Club logo

Comments (8)

JamesMc86 avatar JamesMc86 commented on July 29, 2024 1

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)

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

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?

from g-cli.

OlivierJourdan avatar OlivierJourdan commented on July 29, 2024

I didn't dive into the code to see where the issue was. So, I haven't ideas how to fix it properly.
From a user standpoint, I'm fine if extended characters are not displayed. I'm sure your time could be more valuable on other issues.
IMO, the important thing is not to be stopped by an extended character.

from g-cli.

JamesMc86 avatar JamesMc86 commented on July 29, 2024

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:

  1. Simplest is to do a lossy conversion to UTF8 in Rust.
  2. We can convert to UTF8 in LabVIEW. There appears to be a function for this in described at https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000159jOSAQ&l=en-GB
  3. We can convert from ExtendedASCII to UTF8 in rust. There is an encoding library but we would have to determine the current code page from the Windows API - and consider cross platform concerns

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.

from g-cli.

OlivierJourdan avatar OlivierJourdan commented on July 29, 2024

I'm not sure 2 will work. If I remember, that was the first thing I tried, and it was unsuccessful.

from g-cli.

OlivierJourdan avatar OlivierJourdan commented on July 29, 2024

Nice. If you want me to test something, just let me know.

from g-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.