I am struggling to write a Python (version 2.7) script which makes use of some unicode properties. The problem arises when I attempt to use embedded locale package. Here is the code snippet that I am having issues with:
# -*- coding: utf-8 -*-
import datetime
import os
import locale
locale.setlocale(locale.LC_ALL, 'greek')
day = datetime.date.today()
dayFull = day.strftime('%A')
myString = u"ΚΑΛΗΜΕΡΑ"
print myString
print dayFull
While dayFull
prints the current day name just fine (in greek letters), myString
comes out in console as question mark characters. How can I fix it, can someone please point out my mistake here?
P.S. My system is a Windows 7 machine.