Solved How to convert german umlaut characters to corresponding English characters ?
-
Currently I am facing an issue with the file names containing german umlaut characters.
Example:
If the folder name has “lücke” it doesn't work.
Need to be converted to “luecke”.How to convert umlaut characters to English ?
Thanks in advance.
-
@QtVik said in How to convert german umlaut characters to corresponding English characters ?:
it doesn't work
What doesn't work?
-
@jsulm Say if you have this umlaut character in the file name then that file doesn't open.
-
@QtVik Can you show your code where you try to open the file? It should work.
Replacing some characters in the file path with others will for sure not solve your problem as the file path will be invalid.
You're most probably doing something wrong in your code. -
@jsulm
I have a method openDataReader which takes the file index and the file name as cstring as shown below:
openDataReader(&m_DataFile[fileIndex], fileName.toStdString().c_str() )Does passing file name as cstring here is causing any problem ?
-
@QtVik You should rather use http://doc.qt.io/qt-5/qstring.html#toLocal8Bit
And why do you need std::string? You don't use QFile? -
@QtVik said in How to convert german umlaut characters to corresponding English characters ?:
I have a method openDataReader which takes the file index and the file name as cstring as shown below:
-
@jsulm The openDataReader() is a library method which accepts file name as cstring .
The filename in a local function where it is called i am using QFile to check if the file exists.
Hence using toStdString().c_str().However converting toLocal8Bit worked !! Thank you so much for your input.