View Issue Details

IDProjectCategoryView StatusLast Update
0007253ardourbugspublic2019-05-12 19:25
Reporterjmtrivial Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformamd64OSGNU/LinuxOS Versiondebian sid
Summary0007253: Cannot import files with utf8 characters by drag&drop
DescriptionI'm using KDE as window manager, and I'm used to drag&drop wav files from dolphin to ardour to import them.
It works perfectly with files that are only containing "basic" characters, but does not work with utf8 characters.


Steps To Reproduce1. Start an ardour session
2. Drag&drop a file with an accent in its name (such as "é")
3. Watch the journal window:

[ERROR]: Import?: impossible d'ouvrir le fichier Audio "/media/jm/audio data/banque de sons/piezo/janvier 2017 (alice)/choc métallique et fluctuation 1.wav"
TagsNo tags attached.

Activities

jmtrivial

2019-05-11 23:37

reporter   ~0020648

Several tests:
* this problem do not append using the "import" dialog
* this problem do not append using a drag and drop from nautilus, only from dolphin.
I'm not sure, but I suspect that it comes from an error in the utf8 conversion, probably in Editor::convert_drop_to_paths...

jmtrivial

2019-05-12 19:25

reporter   ~0020650

I found a way to fix this problem, by using a supplementary conversion of the data.get_text() string before reading file names. On my system, the attached patch works for drag and drops from dolphin and from nautilus.

Here is the pull request on github: https://github.com/Ardour/ardour/pull/450
utf8.diff (394 bytes)   
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 4f4bee483..682cc281c 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -3313,7 +3313,7 @@ Editor::convert_drop_to_paths (
 		   THERE MAY BE NO NULL TERMINATING CHAR!!!
 		*/
 
-		string txt = data.get_text();
+		string txt = Glib::convert(data.get_text(), "ISO-8859-1", "UTF-8");
 		char* p;
 		const char* q;
 
utf8.diff (394 bytes)   

Issue History

Date Modified Username Field Change
2017-02-25 15:53 jmtrivial New Issue
2019-05-11 23:37 jmtrivial Note Added: 0020648
2019-05-12 19:25 jmtrivial File Added: utf8.diff
2019-05-12 19:25 jmtrivial Note Added: 0020650