Bug 1732

Summary: Import fails and export hangs if non-ANSI characters are present in the path
Product: PulseView Reporter: Eugene Muzychenko <reg.sigrok>
Component: File handlingAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: 0.5.0   
Target Milestone: ---   
Hardware: x86   
OS: Windows   
Attachments: Screenshots from PulseView and Process Monitor

Description Eugene Muzychenko 2021-09-02 10:32:27 CEST
Created attachment 748 [details]
Screenshots from PulseView and Process Monitor


If non-ANSI characters (for example, cyrillic) are present in file path, file import fails, and file export hangs.

Session load/save operations are not affected.

Steps to reproduce:

Create a directory with non-ANSI characters in the path (I used cyrillic "C:\Tmp\Файлы\"), place a file to it, and try to import it.

Load a session (or import a file) from an ANSI path, then try to export it to this directory with non-ANSI path.

Actual results:

PulseView fails on the import and hangs on the export. Process Monitor shows that non-ANSI characters in the path are corrupted (see the attachment).

This is due to ANSI version of CreateFile functon (CreateFileA) being used.

On the import, PulseView shows "Failed to load file" message with the correct path (see the attachment).

Expected results:

Successful import/export by using Unicode version of CreateFile (CreateFileW).

Versions affected:

0.4.2 release, 0.5.0-git-3ce5dd9 nighty build.