-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for wstring in the future? #41
Comments
Can you expand on your use case? Currently I assume that users are dealing with "arrays of char" and that people should just use a variable width encoding (ideally UTF-8) if they want support for additional characters. Assuming UTF-8 seems good enough for the kind of portable command line applications I tend to write, where the conversion to UTF-16 can be handled at the windows API boundary if you happen to be using windows. So I personally don't have much use for this, and I probably won't have time to implement it myself. However, I'm open to pull requests, with one major requirement: they shouldn't increase the size of the codebase by a large amount - it's already too large ;-) So what do you want to be able to write, and what API should it follow? Currently tinyformat is basically " |
Hi Chris,
In short, yes, exactly! Basically I've got string/wstring format support in my codebase, based on _vsnprintf / _vsnwprintf - wstring being used a lot for UI and is a lot easier to handle/manipulate than UTF-8. All the best, Filip |
Thanks for the feedback, I think equivalents of |
Ha ... i was going to open the same issue and even PR ! Good I decided to look around. @c42f The problem with just adopt UTF8 encoding for narrow chars (char*) is that it won't work on windows. There is no UTF8 support , and for good historical reasons, so long story short unicode only works as UTF16 and any 8bit char is interpreted as windows code-page: https://en.wikipedia.org/wiki/Windows_code_page There are quite nice articles I had bookmarked if interested? Anyway, we just need an overload for each function accepting char* or/and std::ostream Shell I give it a try? What design do you prefer: overloads or templates specialization? |
Well there's If you want to give it a go, I suggest we'll just have to template all the things otherwise there will be a lot of code duplication. Basically every API function dealing with After that's done we'll have to assess the damage ;-) |
100% on the same page; "After that's done we'll have to assess the damage ;-)" that's stopping me it is alot of change, though trivial :( depends whether we continue using it at my company, then I might invest some quality time to update the lib and push upstream! Let's keep this ticket open a bit more OK!? |
(would be nice) :)
The text was updated successfully, but these errors were encountered: