Reputation: 33
I have a common string, which is encoded like ISO-88-59-5 and I want to transform this string to UTF-8 format, by the way, I have the code example on C# which is working well. I need to do the same on C++
result = mainString.Substring(nameStart + 3, symbols);
Encoding enc = Encoding.GetEncoding("ISO-8859-5");
byte[] bytes = enc.GetBytes(result);
result = Encoding.UTF8.GetString(bytes);
result is a string with text
Upvotes: 1
Views: 1299
Reputation: 118310
The procedure to do this on Linux is as follows:
Use iconv_open()
as described in its manual page to create a handle for a conversion from windows-1251 to UTF-8. I just double-checked and "windows-1251" is supported by the iconv library.
Upvotes: 1