Code Monkey home page Code Monkey logo

Comments (3)

DuffsDevice avatar DuffsDevice commented on July 26, 2024

Hi there,

tiny-utf8 is a container for utf8-encoded unicode codepoints. It has no insights into the meaning of certain codepoint values.
In principle, what is necessary to compare two strings (=two codepoint values) case-insensitively is a Database of Codepoints and their relations (e.g. x is uppercase of y, and so on). I'm sorry, tiny-utf8 was not built for this task. ICU provides such a database.

However, once you have figure out how to compare two codepoints case-insensitively, you can do the following:

tiny_utf8::string str1, str2;
bool is_same = std::equal( str1.begin() , str1.end() , str2.begin() , str2.end() , []( char32_t cp1 , char32_t cp2 ){
    return codepoint_insensitive_compare( cp1 , cp2 );
} );

Good luck! Let me know, if there is something else I can help you with.

Jakob

from tiny-utf8.

siavee avatar siavee commented on July 26, 2024

Hi Jakob,

Thank you very much for your answer, it's very clear. Also I'd also like to thank you for such a wonderful library, it has helped me a lot!

Thanks again!

Avi

from tiny-utf8.

DuffsDevice avatar DuffsDevice commented on July 26, 2024

Hi Avi,

Yes, sure! Thank you for your words, I'm happy to hear that it has served you.
And it really is my pleasure! It is messages like yours that remind me of why I'm doing this 😊

Jakob

from tiny-utf8.

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.