C++ Convert any character sequence to any standard string

Four standard char types can be transformed to each other
Four standard char types can be transformed to each other

(Note: this is the second part of C++ : codecvt deprecated. Panic? )

Update

Due to popular acclaim I have made and published a stand alone and fully functional code described in this post. It is in the form of Github Gist here.

It is also updated and optimized. Enjoy …

Update

This is not a foreign language translator or some such code.  This is a standard  C++ 17 utility to transform  the core character sets between each other.  The first 127 characters, that is. As a such it is remarkably useful and simple. For full blown, locale aware solutions please look elsewhere, starting from here.  End of update.

Standard C++ std lib, is one very complete and useful library. But there are times when you do realize you can build one or two of very simple utilities on top of it.

Simple but sometimes surprisingly powefull. Continue reading “C++ Convert any character sequence to any standard string”

C++ Windows Unicode Console Output

unicode gone wrong

Update 2019-11-11

Not much has changed in the WINLAND console world. Still, the following code produces no output.

Unless you do spend time digging through this long post or other similar posts elsewhere. Generally doing things, Linux/Mac console developers users, have never heard of.

For example. I have never mentioned ‘u8’ (UTF-8) string literals. That is an iso C++ native way to use UTF-8 encoding of char string literals.

To actually make the above work, you need to do two more “things” as ever: make sure chcp 65001 is executed beforehand, on the same console (in WIN10 it *should* be the default), and of course if not already switch to the font that can show these glyphs.

Yes, to code in a truly portable fashion, I suggest using char8_t as bove.  Alternatively, one can always try a bit more relaxed style:

But be prepared to be surprised by your compiler, at least for a while until it exhibits a full C++20 conformance.

Windows Terminal 1.0

Yes, there is much more I can write about this whole issue, but I decided not to.  Yet. Let’s allow the WIN team leadership to release a stable and bug-free new console subsystem first. Apparently that is “spring 2020”.

Continue reading “C++ Windows Unicode Console Output”

Dear Chairman: Please keep your eyes on the road

nokia-2012-sep
Somehow the Roadmap was not followed. Best navigation App did not help.

As a business leader, do keep on engaging with Enterprise Architects regularly.

You are the captain, Architect is the navigator. You say where to go, Architect says how to get there.

At least twice per year check with your Enterprise Architects, are you actually where the markets wanted you to be.

Vision and Road-map are long term navigation maps, best owned by good and forward-thinking Enterprise Architects. Don’t let something “amazing” surprise you, as it happened to NOKIA