https://bugs.winehq.org/show_bug.cgi?id=52805
Bug ID: 52805 Summary: winepath does not work for non-western characters Product: Wine Version: 7.6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: nemonein@gmail.com Distribution: ---
OS : ArchLinux Wine : 7.6-1 WINEPREFIX : $HOME/.wine
------
winepath does not work well on non-western characters.
$ wine winepath -w "/home/arch/다운로드/" Z:\home\arch?ㅼ슫濡쒕뱶\
It should be Z:\home\arch\다운로드.
https://bugs.winehq.org/show_bug.cgi?id=52805
--- Comment #1 from Rafał Mużyło galtgendo@o2.pl --- ...it might be a bit more complicated...
Did you try to pipe it to less ? cause chances are you'd get the string you expect then...
So, wine seems to be setting output encoding (not through reencoding, but setting up the output descriptor wrong) not quite right. I've seen something similar in some Unity games where some of the localized debug messages were mojibake...unless piped to less (or perhaps it was through tee to a file - don't fully recall that).
https://bugs.winehq.org/show_bug.cgi?id=52805
--- Comment #2 from nemonein@gmail.com --- Thank you. pipe to less works. Using tee also works.
$ wine winepath -w "/home/arch/다운로드/" | tee /dev/null Z:\home\arch\다운로드\
I think tee could be a good work around.
However, assigning to a variable is a bit weird.
$ foo=$(wine winepath -w "/home/arch/다운로드/") $ echo $foo Z:\homerch\다운로드\
\a is removed, because \a is an alert sequence. Is there a way to correct this issue?
https://bugs.winehq.org/show_bug.cgi?id=52805
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@orange.fr
--- Comment #3 from Eric Pouech eric.pouech@orange.fr --- the printing goes wrong without tee as the chosen characters are not part of the windows code page for the console...
using tee force writing directly to file without going through the windows console, hence the difference
fixing it might not be easy as we need to choose between: - do we use the window console's semantic - do we use the unix console's semantic (here you might want unix, but that's not always the case) It's possible to tweak winepath to do what's expected, but I'm still quite unhappy with the patch... need to think more about it
Anyway, I'm a bit surprised by results in Comment #2 - would it possible that you have some shell alias for echo being 'echo -e', or xpg_echo in bash turned on? - anyway using echo -E $foo should do what you want
https://bugs.winehq.org/show_bug.cgi?id=52805
--- Comment #4 from nemonein@gmail.com --- Thank you Eric Pouech. I need to use tee for the time being.
And about the 'echo' command, I'm using zsh, and I have no idea, but the default option might be '-e' for zsh. echo -E works good on zsh.
---------------------------------------------------------- I have one more question to ask. It's a bit complicated, but please understand what I meant. (English is not even my last language, so it's very difficult for me to make you understand.)
I made a wrapper script to run Wine(mp3tag.exe) program. It's simply change the path name to Windows one, using winepath.
The script(shell) is something like this. Let's call this 'run_mp3tag.sh'.
wine_music_dir=$(/usr/bin/wine winepath -w "$1" | tee /dev/null) env WINEPREFIX="$HOME/.wine" wine 'C:\Program Files (x86)\Mp3tag\Mp3tag.exe' /fp:"$wine_music_dir"
---- If I run this script on a terminal, it works fine.
$ run_mp3tag.sh "<some_directory/filename>"
Then, I made .desktop file to run this script. [Desktop Entry] Name=Mp3tag Exec=run_mp3tag.sh %f Type=Application StartupNotify=false Path=/home/nemoarch/.wine/dosdevices/c:/Program Files (x86)/Mp3tag Icon=5632_MP3TAG.0 StartupWMClass=mp3tag.exe Terminal=false
--- I made an association with this program and music files, then I opened it on a Dolphin desktop manager(KDE), winepath does nothing. mp3tag started, but with error, "Directory cannot be accessed." It means $wine_music_dir does not have any value.
I have no idea why this does not work all of a sudden. And I want to tell you that IT had WORKED for a long time. Suddenly it stopped working.
https://bugs.winehq.org/show_bug.cgi?id=52805
--- Comment #5 from Eric Pouech eric.pouech@orange.fr --- (In reply to nemonein from comment #4)
Thank you Eric Pouech. I need to use tee for the time being.
And about the 'echo' command, I'm using zsh, and I have no idea, but the default option might be '-e' for zsh. echo -E works good on zsh.
I have one more question to ask. It's a bit complicated, but please understand what I meant. (English is not even my last language, so it's very difficult for me to make you understand.)
I made a wrapper script to run Wine(mp3tag.exe) program. It's simply change the path name to Windows one, using winepath.
The script(shell) is something like this. Let's call this 'run_mp3tag.sh'.
wine_music_dir=$(/usr/bin/wine winepath -w "$1" | tee /dev/null) env WINEPREFIX="$HOME/.wine" wine 'C:\Program Files (x86)\Mp3tag\Mp3tag.exe' /fp:"$wine_music_dir"
If I run this script on a terminal, it works fine.
$ run_mp3tag.sh "<some_directory/filename>"
Then, I made .desktop file to run this script. [Desktop Entry] Name=Mp3tag Exec=run_mp3tag.sh %f Type=Application StartupNotify=false Path=/home/nemoarch/.wine/dosdevices/c:/Program Files (x86)/Mp3tag Icon=5632_MP3TAG.0 StartupWMClass=mp3tag.exe Terminal=false
I made an association with this program and music files, then I opened it on a Dolphin desktop manager(KDE), winepath does nothing. mp3tag started, but with error, "Directory cannot be accessed." It means $wine_music_dir does not have any value.
I have no idea why this does not work all of a sudden. And I want to tell you that IT had WORKED for a long time. Suddenly it stopped working.
that's a known bug see https://bugs.winehq.org/show_bug.cgi?id=52771 and https://bugs.winehq.org/show_bug.cgi?id=52743 and it's not related to the problem you opened this bug with...
so I advise you follow up for comment #4 on those two other bugs
https://bugs.winehq.org/show_bug.cgi?id=52805
--- Comment #6 from Rafał Mużyło galtgendo@o2.pl ---
the printing goes wrong without tee as the chosen characters are not part of the windows code page for the console...
I've never said that - it was always about the method of opening and setting up stdout (so either msvcrt or ntdll/kernelbase).
https://bugs.winehq.org/show_bug.cgi?id=52805
--- Comment #7 from nemonein@gmail.com --- @Eric. I really appreciate your help. Thanks to you, I've just found a workaround.
<For non-western/ASCII characters> 1. on Terminal Using tee is a solution.
$ winepath -w "<DIR>" | tee
2. on Scripts Store command output to a variable. tee is not needed.
$ foo=$(winepath -w "<DIR>") $ echo -E $foo
<For wrapper scripts> Instead of 'winepath', use full path.
bar=$(wine 'c:\windows\syswow64\winepath.exe' -w "<DIR>")
https://bugs.winehq.org/show_bug.cgi?id=52805
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source