Thanks for the answer d_stranz.

I don't want to make any change to the code because Qt4 under Windows DOES work as intended and also Qt5 under Linux. And I am not making anything fancy there. Just using the "QString::replace()" function and I expect it to behave like the documentation writes.
I just want to understand why Qt5-Windows behaves differently. Any clues?

BTW, the source file is ALWAYS in UTF8 (will add this to the first post, forgot about that).

Quote Originally Posted by d_stranz View Post
Try converting your strings to Latin1 or utf-8 before doing the replace on the resulting QByteArray. Don't know if this will help. Character conversions and codepage issues can be very tricky.