testdisk
testdisk copied to clipboard
Support for path that include Japanese text for QPhotoRec
Recently I tried to recover some files from .img file(that I grabbed from a 8GB SD card, which has corrupted partition table) and I found this issue:
QPhotoRec does not load .img files(or other images) from a folder/file that has any Japanese characters in its path.
I got this issue with the following environment:
- Windows 10 Home, build 17763.504 64 bit
- CPU: Intel, i7-4712HQ and MEM: 7.89GB of usable RAM
- Language: Japanese
- The file system of the storage that my .img file was on: exFAT also I got the same issue with NTFS.
How to reproduce:
- Put your .img file in a folder that has some Japanese characters (In my environment: "D:\作業フォルダ\Data.img" ) Note: You can include some Japanese characters in your file name instead of folder's name to reproduce this issue.
- Start QPhotoRec, choose "Add a raw disk image..." in the image selection, then select the file of step 1 (make sure to check the path to the file has at least 1 or more Japanese characters)
- Done! Nothing changes on GUI.
I also confirmed this issue with some other paths: "C:\ほげ\ABC.img" "C:\Hoge\ぷよ.img".
I got a bit worried but anyway I could recover my files from the image by moving it to D:\ . I must thank for this good software, anyway.
The problem seems to be Windows specific. I have no problem with qphotorec under Linux. Extract from qphotorec.cpp
void QPhotorec::newSourceFile()
{
const int testdisk_mode=TESTDISK_O_RDONLY|TESTDISK_O_READAHEAD_32K;
QString filename = QFileDialog::getOpenFileName(this,
tr("Please select a raw file"),
"",
tr("Raw Files (*.dd *.raw *.img)"));
if(!filename.isEmpty())
{
disk_t *new_disk=NULL;
QByteArray filenameArray= (filename).toUtf8();
list_disk=insert_new_disk_aux(list_disk, file_test_availability(filenameArray.constData(), options->verbose, testdisk_mode), &new_disk);
if(new_disk!=NULL)
{
select_disk(new_disk);
HDDlistWidget_updateUI();
PartListWidget_updateUI();
}
}
}