Unknown reporter writes

Hello,

In the result of Recoll, I would like to copy the filename but when I copy it, the charset doesn’t work.

For example : In recoll I can see : Boîte de réception And when I copy it in Gedit or Kwrite : Boîte de réception

Thank you for your answer

medoc writes

Hello, In fact, I just don’t really know how to fix this.

File names are binary data, and Recoll stores them as such. When you click "Copy File Name" I call a Qt function which is normally used to copy text to the clipboard. This does an implicit conversion from iso-latin1 which is certainly wrong in this case as your file name looks like UTF-8. I’d guess that you are using an UTF-8 locale, so that QT converts the supposed latin1 (actually already UTF-8) text to UTF-8 before passing it to the system, and you end up with the strange characters in the other app.

The thing is, there should be a specific way to copy file names to the clipboard, but there does not appear to be one (in the Qt API), and I don’t know what to do. I have no way to know what encoding the file name uses (if any). I could make a guess and try to use the locale’s, but nothing guarantees that this would be right (ie: if the file comes from somebody who is using another locale, the conversion will be wrong).

In the current state of things, good file names are ASCII file names. However, the attached patch implements the above solution which is probably better than using iso-8859-1 in all cases, but remains a bad solution. Please try it and tell me how it works for you.