[Github-comments] [geany] Under Windows geany couldn't open file which was found by grep utility (Cygwin) with non ascii filename. (#783)

Enrico Tröger notifications at xxxxx
Tue Dec 15 16:34:16 UTC 2015


Got a few more details:
at first, this is a problem in grep.exe (at least this one distributed with Geany, maybe other/better binaries are out there):

if I run the grep command on the cmd.exe, I also get the `grep: ./??????: Invalid argument` result. But in your screenshot you got those squares.
![win32_grep_unicode](https://cloud.githubusercontent.com/assets/617017/11814977/ed323d42-a349-11e5-9ada-d11d0ead4202.png)

For futher testing, I created a directory with a German umlaut (`lalelö`).
Result in cmd.exe:
![win32_grep_mixed_cmd](https://cloud.githubusercontent.com/assets/617017/11814994/022d542a-a34a-11e5-9b6e-ebcf2d4b72b1.png)

Result in Geany:
![win32_grep_mixed_geany](https://cloud.githubusercontent.com/assets/617017/11814996/074105e2-a34a-11e5-8bc6-e7ce3568c3a7.png)

cmd.exe displays the folder name `lalelö` correctly but is not able to display correctly the UTF-8 encoded search result.

In Geany, the result is vice-versa: the folder name is displayed incorrectly but the UTF-8 parts are displayed properly.

So, related to #784, we probably need to convert the output from external commands back from UTF-16 to UTF-8. Though I doubt whether this can ever work properly if in the same output there is also UTF-8 encoded text. At least I have no idea how this could work.

For curiosity, I just tested grep.exe from the MSYS2 environment:
![win32_msys2_grep_mixed_geany](https://cloud.githubusercontent.com/assets/617017/11816518/041f3e2c-a351-11e5-8aa3-c34405843ea6.png)

So yeah, MSYS2 grep.exe seems to work nicely with Geany.
@NTMan it would be cool if you could test the grep.exe in the archive at http://repo.msys2.org/msys/x86_64/grep-2.22-1-x86_64.pkg.tar.xz. This is exactly the same as I used for the last test (verified with md5sum). I'm not sure whether this binary is supposed to work without a MSYS2 environment and I cannot test this.

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/783#issuecomment-164819917
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20151215/9167c8da/attachment.html>


More information about the Github-comments mailing list