473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

questions about locale and Windows

Regards.

I have a few questions about locale handling on Windows.

The first: why getlocale() returns (None, None) when the locale is 'C'?

The second is: why this code fails?:
loc, enc = locale.getdefaultlocale()
print loc, enc it_IT cp1252 locale.setlocale(locale.LC_ALL, (loc, enc))
Traceback (most recent call last):
File "<pyshell#15>", line 1, in -toplevel-
locale.setlocale(locale.LC_ALL, (loc, enc))
File "C:\Python2.4\lib\locale.py", line 381, in setlocale
return _setlocale(category, locale)
Error: unsupported locale setting
Fortunately locale.setlocale(locale.LC_ALL, '')

'Italian_Italy.1252'

and
locale.setlocale(locale.LC_ALL)
'C'

works...

Thanks Manlio Perillo
Dec 23 '05 #1
0 1071

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: WX | last post by:
I love Python, and the unicode support is wonderful. The character set I am using is the Hindi/Devanagari character set at unicode range U+901.) I have TWO newbie questions: (#1) If I paste...
6
by: Nemok | last post by:
Hi, I am new to STD so I have some questions about std::string because I want use it in one of my projects instead of CString. 1. Is memory set dinamicaly (like CString), can I define for...
4
by: Jane | last post by:
I cannot get Korean data to show up in Command Center or Crystal Reports. I wrote a small JDBC program and that is working fine. Here are the details. DB2 Server : AIX DB2 8.1.3 64 bit...
0
by: Henry | last post by:
Using ideas provided by some of you I was able to figure out how to get the names of the parameters fields of a crystal report specified at run time. The code below just basically puts the...
1
by: Kenneth McDonald | last post by:
I am going to demonstrate my complete lack of understanding as to going back and forth between character encodings, so I hope someone out there can shed some light on this. I have always...
0
by: R | last post by:
Hi all, I have a simple question about locale and PHP5. I'm using polish characters but I encode them in UTF-8. I was sorting an array with usort($array, 'strcoll'); but I've entred a...
4
by: maxt | last post by:
I am using Windows XP, Tomcat 5.5.17, JRE 1.5.0_08. I am in Australia. For testing localization, my Windows Region is set to English, US. The Tomcat xml's are set to their install defaults. ...
2
by: Daniele C. | last post by:
I will report a snippet from http://php.net/setlocale I spent about 2 seconds before thinking: can it really be? I mean, is there no way to set locale info per thread? And after a brief web...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.