5 ms·
Unicorn: C++ Unicode string library
- maaku 11y agoYour github pages breaks the back button.
- captaincrowbar 11y agoNo idea what you mean, sorry. I'm just using Github's automatically generated web pages, so if there's a problem there it's probably a Github issue.
- geekone 11y agoProbably referring to the Documentation link you provide on the GitHub page, and it breaks back button for me too.
- funkaster 11y agoI think it's the htmlpreview: the back throws you into a redirection to the current page.
- captaincrowbar 11y agoI just tried that on several browsers; Safari and Chrome are fine, it seems to be only Firefox that has a problem with that. I have no idea whether that's a bug in Firefox or Github, and either way there's nothing I can do about it, sorry.
- funkaster 11y agoyes, you can: publish your docs as real web pages and not a link to the htmlpreview of a file inside your repo. That should fix the problem.
- dpark 11y agoI guess he should have said that there's nothing reasonable he can do about it. Creating an entirely separate set of HTML pages would require a new publishing flow, add a new step every time docs update, and generally encourage the docs to fall out of sync with the repo. He could do all of this, or he could do the sensible thing and leave the docs exactly like they are.
- lomnakkus 11y agoHmm... weird. I guess this should either be reported to the GitHub people and/or the Firefox people?
- sdegutis 11y agoThat's not fair. It's pretty well known that Github uses JS to hijack page navigation and make it "smoother" for people. And of course that's going to be faulty, and I emailed them years ago when they made the switch, and asked them to make it an optional behavior because I hate it. But that has nothing to do with OP or OP's link or content. It's like judging a book by the book store.
- xjia 11y agoAnyone can compare this to Boost.Nowide?
- aurelian15 11y agoLooks like a nice project. I'm currently searching for a Unicode library and it appears to me that ICU is the de-facto standard here, which has the benefit of comming pre-installed on pretty much any Linux distribution. Any reason why I should use Unicorn instead? I couldn't find information on how it compares to ICU in the documentation (well, except for the most welcome usage of modern C++).
- rspeer 11y agoIt looks like Unicorn can apply operations (such as regexes) to text that is natively in UTF-8, giving it a distinct advantage over ICU, which was written back when UTF-16 seemed like a good idea and has to convert everything into UTF-16.
- fantasticfears 11y agoIt's hard but needed to differentiate between UTF-16 and UChar byte array. UChar byte array are not essentially an well-formed UTF-16 string. Beyond, why bother use UnicodeString? It's fairly easy to use. It covers the detail from your sight. It's indeed super cool to see a modern Unicode C++ library. But anyway, is it really useful for production usage? The answer could be no. In contrast, ICU was old, battle-tested, compact and well-tested.
- rspeer 11y agoI'm talking about using UTF-8 as the string representation, not UChars. UChars are an artifact of UTF-16, and thus require converting all text on input and output, unless you work in a Windows API world where I/O is UTF-16. Modern programming languages such as Rust gain efficiency by working with unmodified UTF-8. All you lose is constant-time arbitrary indexing, which is a bad idea in most cases anyway.
- jstimpfle 11y agoWhy is a bad idea? Because Unicode has too complicated semantics to split a Unicode string at arbitrary points?
- cmrdporcupine 11y agoThe unicode portion looks reasonable, but why is it necessary for it to include its own flags, file io, file management, and environment classes? Why is it so many C++ libraries fall into this habit of trying to build one big framework. I'm perfectly happy with gflags -- a unicode library would be nice for my project, but now I won't consider this library.
- captaincrowbar 11y agoBecause the whole point is to handle anything that needs Unicode support. A library that only manipulated Unicode strings would be incomplete if you still couldn't use Unicode in command line options, file names, etc.
- cmrdporcupine 11y agoI would recommend breaking them off into separate additional libraries. I don't need unicode for flags, so paying for it at compile and link time seems unwise. Or provide adapter classes that can be used over other frameworks. Just a suggestion.
- nly 11y agoThat's what will happen until there's a defacto/standard library for this stuff. Languages like Python and Go have a wider base in the standard library. C++14 still only gives you platform dependent 'wide' strings, UTF-8 string literals, and UTF-8 conversion... which makes things awkward.
- vidoc 11y agoSeems like the word 'Unicorn' is currently the buzzword of 2016 in tech!