Help me to understand. I run the script in Raspberry PI in Python 2.7.9:

#! /usr/bin/python # -*- coding: utf-8 -*- print "Hello" print "Привет" print u'Привет' 

Result:

Hello

п ÷ I─п╦п╡п╣я┌

п ÷ I─п╦п╡п╣я┌

File saved in UTF encoding (without BOM). Russian language in the console is present. I do not understand what's the matter.

  • 2
    Console encoding what? - Sergey Gornostaev
  • How to view this encoding correctly? at the locale command, it issues LANG = en_GB.UTF-8 LANGUAGE = LC_CTYPE = "en_GB.UTF-8" LC_NUMERIC = "en_GB.UTF-8" LC_TIME = "en_GB.UTF-8" LC_COLLATE = "en_GB.UTF-8" LC_MONETARY = "en_GB.UTF-8" LC_MESSAGES = "en_GB.UTF-8" LC_PAPER = "en_GB.UTF-8" LC_NAME = "en_GB.UTF-8" LC_ADDRESS = "en_GB.UTF-8" LC_TELEPHONE = "en_GB.UTF -8 "LC_MEASUREMENT =" en_GB.UTF-8 "LC_IDENTIFICATION =" en_GB.UTF-8 "LC_ALL = - Nick495

1 answer 1

Problem solved. The whole thing was in the settings Putty. It was necessary to simply set the default: Putty Configuration - Window - Translation: Received data: = UTF-8. After that in Python began to be displayed as it should.