Curl command output has incorrect encoding

when i do

curl "http://weather.yahooapis.com/forecastrss?w=1225955&u=c" 

it returns me the answer with the wrong coding:

 khan@khan-P55A-UD3P :~$ curl "http://weather.yahooapis.com/forecastrss?w=1225955&u=c"    dž   ud@3   v(     $j$  ~    4(   Xy    wH o 9<q  , s\  e" tA \݌h ʄ         h  M   {   J= m93W  S ) e [sv, ҉eAKM z{ǔ  g  :   *     (n m  & Jꟈ  Mg ,yn?F &  _   ik6 >  0 e&X  簺sQ~ : Z;*9 .a"ߕ|  EO[ 5" ׫[ k     1ӆ n?}r1 u d  Cڐ  X  ` NF g! c  W  G  1 o    Z  53<z`   .  w  s׃  ߖ+ vh  3yt b} 9  6 s3K  W   0 ه F@    > X֥Qh ʰv BQ R ʮ < 4; ڊ2 8y   g   6M(  ] |'  U@  ș B  8du! &' NOB  ț  3 K  fW   \Rheg =  F R; u F s9   &    ,  |r  o E۲ T  V$&     uf\      v  Z~& Au  {  ى"m ʨ   U    2 8 # 0F@ '       l   R XL  ~A  ̱   p  9  8 iH  nC i4  ^t;    ۪   d V     7  =S&  2 u #v~ L` k   v 0  [   "<   ~ z  j,   X= zmKD/|   ( p  M   ⥁}_ !  GџC  2| G  <ফe  nb"x ? e s  ;   r;ﲃ ] 9"l  ; } w ٮjwR[ C    #O         #a    s km   $a     \) $ o  Ә K  FR * ý l Z   & `_ D WӠ >`T  0  | c  ⿎K%  n:   ~(     .{  }< /~ ^!A  $\   c < Á "  k _  t    t n 5 ^t وF  l<V     oo? `O   3p  ĝ S X G x  Ź+  khan@khan-P55A-UD3P :~$ 

However, the same command works fine on another computer. Is there anything I need to install in the shell in order to get this in the correct format?

im using ubuntu 14.04 64 bit. (Linux khan-P55A-UD3P 3.13.0-40-generic # 69-Ubuntu SMP Thu Nov 13 17:53:56 UTC 2014 x86_64 x86_64 x86_64 GNU / Linux)

any ideas? here you can also see a screenshot of this command: http://i.imgur.com/QDy7F7i.png

+5
source share
2 answers

I think this is due to the default encoding of your terminal (the default is UTF-8). You can try to transfer the stream to a file, for example:

 curl "http://weather.yahooapis.com/forecastrss?w=1225955&u=c" > response 

I had the same problem with the rest of the webservice when I skipped bytes (Pdf content format inside the Data Handler). Without going through the stream, I received data encoded in UTF-8 in the terminal, and also when I used soapUi.

+1
source

Try setting the terminal encoding to utf-8. Google got this: https://unix.stackexchange.com/questions/28136/set-gnome-terminals-default-charset-to-utf8

Before setting the encoding check, make sure that this is really a problem by defining the current encoding as in:

How to get character encoding in terminal

+1
source

Source: https://habr.com/ru/post/1207924/


All Articles