Comments (3)
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.
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.
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)
- Grapheme cluster HOT 1
- Compilation issue HOT 1
- Empty std::string problem HOT 3
- How to use the bidi algorithm with TinyUTF8? HOT 4
- Warnings when compiling with Clang 9 HOT 3
- Unexpected push_back result HOT 1
- Comparison operator doesn't match std::string HOT 2
- C++20 HOT 2
- GCC < 8: error: 'get_sso_capacity' was not declared in this scope HOT 3
- MSVC x86: error C3861: '_BitScanReverse64': identifier not found HOT 1
- append() method with value_type HOT 5
- incorrect string comparison behaviour after a substr operation HOT 1
- erase-remove idiom does not work as expected HOT 8
- Support for string view? HOT 4
- `cpp_str()` impossible to be used with `u8string` HOT 2
- is it possible to make tiny-utf8 case insensitive? HOT 4
- Tricky to use with MSVC and C++20 HOT 7
- RFC: Introduce raw_size() and make size equal to length.
- Incorrect string size of the constructor of tiny-utf8(not only use LITLEN)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiny-utf8.