问题
I am running a stock Cygwin install, with the wget
package added.
If I run a command
wget -qO- tetristv.com/zapni.tv.php
I get this; notice the incorrect display of characters
session=OTA5Mjc0ODU5OA==&stream=play</a></b><br>#EXTINF:0,▒T 1<br><b><a
href="http://212.80.69.19/stream/vlc.php?id=39&session=OTA5Mjc0ODU5OA==&
stream=play" target="_blank" rel="nofollow">http://212.80.69.19/stream
/vlc.php?id=39&session=OTA5Mjc0ODU5OA==&stream=play</a></b><br>#EXTINF:0,▒T
2<br><b><a href="http://212.80.69.19/stream/vlc.php?id=40&
session=OTA5Mjc0ODU5OA==&stream=play" target="_blank"
rel="nofollow">http://212.80.69.19/stream/vlc.php?id=40&
session=OTA5Mjc0ODU5OA==&stream=play</a></b><br>#EXTINF:0,▒T 24<br><b><a
If I just download the file, everything looks fine in Notepad.
wget tetristv.com/zapni.tv.php
回答1:
$ LANG=en_US.CP1252
$ wget -qO- tetristv.com/zapni.tv.php
Result
261&session=NTk1NTg0ODU5OA==&stream=play</a></b><br>#EXTINF:0,Oèko<br><b><a
This also works
wget -qO- tetristv.com/zapni.tv.php | iconv -f cp1252
回答2:
I'm using stock cygwin in Mintty and have my lang set as LANG=en_US.UTF-8
and it's been working fine for me (unfortunately our proxy server is blocking the site you referenced so I can't test that). Check out Internationalization in the cygwin docs for more help.
Edit: verified that this UTF-8 views properly within mintty:
$ cat /d/temp/test.txt
Creds Go here®
来源:https://stackoverflow.com/questions/11050502/cygwin-terminal-not-displaying-certain-characters