Issue1700912
Created on 2007-04-15 08:28 by bavantgarde314, last changed 2007-04-21 07:36 by bavantgarde314.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
idle_question.py
|
bavantgarde314,
2007-04-15 08:28
|
Python routine that reveals questionable behaviour |
|
|
|
msg31793 - (view) |
Author: bavantgarde314 (bavantgarde314) |
Date: 2007-04-15 08:28 |
|
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Windows(ME)
Attachment reveals questionable results from IDLE, Windows, & several built-in functions.
Under IDLE: function swapcase() updates 120 characters.
Under Windows (dos-screen) or a Windows ide swapcase() updates only 52 characters: ord values 65-90 for (uppercase)A-Z and 97-122 for (lowercase)a-z.
Under IDLE: functions lower() & upper() return different results than swapcase()
for hex values: 8a, 8c, 8e, 9a, 9c, 9e, 9f, ff
or ord values 138, 140, 142, 154, 156, 158, 159, 255
or characters Š Å’ Ž š Å“ ž Ÿ ÿ
|
|
msg31794 - (view) |
Author: Josiah Carlson (josiahcarlson) |
Date: 2007-04-19 05:02 |
|
The behaviors of those functions depend on the locale.
Check the results of:
import locale
locale.getlocale()
|
|
msg31795 - (view) |
Author: bavantgarde314 (bavantgarde314) |
Date: 2007-04-21 07:33 |
|
Thanks
import locale
locale.setlocale(locale.LC_ALL, '')
solved my problems.
|
|
msg31796 - (view) |
Author: bavantgarde314 (bavantgarde314) |
Date: 2007-04-21 07:36 |
|
Thanks
import locale
locale.setlocale(locale.LC_ALL, '')
solved my problems.
|
|
| Date |
User |
Action |
Args |
| 2007-04-15 08:28:46 | bavantgarde314 | create | |
|