How to change Latin1-UTF8 encoding in C ++ (possibly with Boost)?

My source database mainly uses UTF8, but some old library encoded Windows Latin1 encoded strings encoded inside it.

I was hoping Boost would have a clear conversion function, but I did not find one. Do I need to manually code this common solution?

Looking for a portable solution that runs on Linux.

( This Q is similar, but not quite the same)

Edit: ICU seems to be the correct answer, but it will outsmart a little for my needs. I ended up with a string replacement for the well-known several extended characters that were used.

+4
source share
1 answer

International Unicode Components (ICUs) really have the solutions you are looking for. Boost can be compiled with support for ICU, for example. for Boost regular expressions, but precompiled versions of Boost do not usually include it.

+3
source

All Articles