karagog / Gryptonite

The next version of GPassword Manager, with a better interface, more secure encryption and less cumbersome name.
https://sourceforge.net/projects/gpasswordman
Apache License 2.0
15 stars 1 forks source link

Importing a file with weird characters failed #60

Closed karagog closed 9 years ago

karagog commented 9 years ago

I was testing a file that has special unicode characters in it, specifically ä. I changed the name to all ascii and it worked, so I can only assume this is the reason.

karagog commented 9 years ago

This problem comes because the GUtil::File class does not properly handle special unicode filenames (is this a Windows-only problem??) It simply calls fopen() which apparently only works with ascii paths. You could potentially use _wfopen() but then you have to convert from char* UTF-8 to wchar_t* and there is no C API function for that so you'd have to add it to the GUtil::String class.

An alternative solution is to not use GUtil::File and instead use Qt's QFile class. I like this solution better because GUtil is not ready for mainstream yet anyways, and I'm almost certain Qt supports this.

karagog commented 9 years ago

Fixed by replacing GUtil::File with QFile: 83e42fabaa12029434be8e1b0f510500ff7761e7