Giter VIP home page Giter VIP logo

Comments (4)

surreylabs avatar surreylabs commented on July 22, 2024

@computerquip-streamlabs When dealing with Unicode, I only plan to support the UTF-8 encoding, because it is compatible with most libraries. May I know if UTF-8 is working for you?

from argtable3.

computerquip-streamlabs avatar computerquip-streamlabs commented on July 22, 2024

It does appear to. That said, the warnings given are valid. These would be incorrect in that case since they assume a 2-byte wchar_t type:

#define TRexChar unsigned short
#define MAX_CHAR 0xFFFF
#define _TREXC(c) L##c
#define trex_strlen wcslen
#define trex_printf wprintf

All functions that use TRexChar are then apt to some weird behavior since it's treated as a 2-byte string rather than a 1-byte string.

I need to try some more complicated UTF-8 codepoints as well that actually require more than one byte a codepoint... this is kinda worrying if I'm honest.

from argtable3.

computerquip-streamlabs avatar computerquip-streamlabs commented on July 22, 2024

It seems the trex code is only used for regex-based argument matching (and isn't used in general). I've just made sure none of my code uses that as I'm sure there's edge cases there. As a result though, I'm not affected and those warnings are little more than a nuisance now.

The original Trex code was meant for just ASCII and then Unicode support through wide-character support. That code would probably need to be modified to make sure it works with UTF-8 though I'm not sure. Some distinctive testing for UTF-8 with the regex argument parsing should probably be done.

from argtable3.

tomghuang avatar tomghuang commented on July 22, 2024

@computerquip-streamlabs I've removed the UNICODE support from the embedded TRex code. I've also fixed some Unicode-related issues so that even when you compile with UNICODE definition in Visual Studio, the library should be compiled successfully.

from argtable3.

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.