-1

Suppose I have a list of 4 songs (basically, in real life I don't know how many songs I have and how are they encoded):

  1. OST Ходячий замок Хаула – Вальс "Карусель жизни"
  2. Fäaschtbänkler – 22 Genres
  3. Röyksopp – Running to the Sea (feat. Susanne Sundfor)
  4. Omega – GyöngyhajúLány

These songs contain

  1. Russian letters
  2. ö, ä, ú

And this is example is far not the worst from what you might find in other cases

Basically, I need one encoding to rule them all, which one do I choose or how do I make it work in an other way?

UPD: Here is what I found on the site with this music

<meta http-equiv="content-type" content="text/html; charset=windows-1251">

Solution

I solved it by downloading win_unicode_console Still don't know how to do that in native python

Denis Rozimovschii
  • 428
  • 1
  • 6
  • 19
  • What's you system, what's the current encoding in your console, what are the supported encodings of your console? What encoding do you use for Python strings? Do you use unicode or byte string? How on earth can we guess anything of that?! – Serge Ballesta May 30 '16 at 11:58

1 Answers1

0

Use utf8 encoding. to write to stdout using utf8, use:

utf8stdout = open(1, mode='w', encoding='utf8',errors='replace', closefd=False)
print("something", file=utf8stdout)
noteness
  • 2,440
  • 1
  • 15
  • 15