Search code examples
bashencodingcygwinwindows-1252cp1252

Cygwin terminal not displaying certain characters?


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

Solution

  • $ 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