Using Python 2.6.4 running under Windows I can set my locale to
Spanish like below:
import locale
locale.setlocale(locale.LC_ALL, 'esp' )
locale.setlocale(locale.LC_ALL, 'esp' )
month names and abbreviations.
import datetime
dateValue = datetime.date( 2010, 5, 15 )
dayName = dateValue.strftime( '%A' )
dayName
dateValue = datetime.date( 2010, 5, 15 )
dayName = dateValue.strftime( '%A' )
dayName
How do I convert the 's\xe1bado' value to Unicode? Specifically what
encoding do I use?
I'm thinking I might do something like the following, but I'm not sure
this is the right approach.
codePage = locale.getdefaultlocale()[ 1 ]
dayNameUnicode = unicode( dayName, codePage )
dayNameUnicode
dayNameUnicode = unicode( dayName, codePage )
dayNameUnicode
Feedback appreciated.
Regards,
Malcolm