Closed rkurbatov closed 3 years ago
Strange - OH uses a normal Qt function to create a temporary file from the firmware resource in QDir::tempPath()
(on Windows this is usually the path in the TEMP or TMP environment variable):
temp_firmware_path = std::unique_ptr< QTemporaryFile >( QTemporaryFile::createNativeFile( firmwareRes ) );
and converts this file name to const char *path = temp_firmware_path->fileName().toUtf8().constData()
that is transferred to fopen()
.
You could try to change %TEMP%
or %TMP%
to something else where you have write access, e.g. c:\temp
.
@spam-receiver: Did you encounter this kind of problem
I confirm the bug. If the Windows 10 username is in Cyrillic, then the oscilloscope is not visible. The program offers to start demo mode. But when firmware was loaded in Latin name user account, then there is no need to load firmware and program starts normally. I often faced such problems with various programs, so, just in case, I become to use the username in Latin, both in Windows and Linux.
Hello, friends of Cyrillic symbols, please check this test build.
If it does not help, you could try to set %TEMP%
and %TMP%
to e.g. C:\Windows\Temp
instead of the default C:\Users\xxx\AppData\Local\Temp
.
Linux users need not worry?
No, because OH uses different locations for the temp file on Windows and Linux.
OpenHantek6022 takes the Qt standard function QTemporaryFile::createNativeFile()
to access the firmware from the program resources via a temporary file in QDir::tempPath()
:
TMPDIR
environment variable or /tmp
if TMPDIR
is not defined (on Debian it is not).TEMP
or TMP
environment variable, that points into the user's tree.EDIT: The issue was (probably) caused by the conversion from QString fileName -> const char *path, for Linux this is done by fileName.toUtf8().data()
, because UTF8 is standard for all localisations. Under Windows the situation is different, they use multiple "code pages", so I had to replace toUtf8()
by toLocal8Bit()
, that fits also for Linux because UTF8
is the local 8bit encoding :)
@Vascom: I did a quick check on my Debian with a disconnected/connected scope:
cd; mkdir Михаи́л_Васи́льевич_Ломоно́сов
TMPDIR=/home/horo/Михаи́л_Васи́льевич_Ломоно́сов ./OpenHantek
Works fine, same for
cd; mkdir Ἀρχιμήδης_ὁ_Συρακούσιος
TMPDIR=/home/horo/Ἀρχιμήδης_ὁ_Συρακούσιος ./OpenHantek
HTH
OpenHantek-Win-x64-Release-b539.zip works normally.
... works normally.
"normally" - hopefully in the sense of "as expected" and not in the sense of "as before". :) Thank you for your support, I will wait for @rkurbatov's "OK" before closing this issue.
It is available in unstable for testing. If I do not receive failure reports I will close this issue after Easter.
Wow, that was really quick.
Sorry, I'm using Linux normally, but attached this box to my old spare Windows desktop (just in case, you know). It works normally now. I checked on Administrator account (that is Администратор on my machine) - old version searches for device, b539 just runs normally. Thanks!
Roman, thx for reporting this sleeping issue. This project lives from user feedback.
Describe the bug The program cannot upload firmware to the device if the user home folder in Windows 10 contains cyrillic symbols.
To Reproduce I tried several drivers without success. As I'm using the Far Manager (good old Linux habit) I saw the warning message in console, it could not open some file in C:\Users\some-strange-symbols\Temp\OpenHantek.someId folder.
When I managed to rename my user folder so it did not contain cyrillic letters the problem disappeared.
Not sure if you can fix it easily for Windows but it least it could help and save some time for other people with non latin letters usernames.