Package: python2.5
Version: 2.5-5
Severity: normal
Tags: l10n
Expected behavior of the program below:
Running the program like this should make it match just the first
string:
LANG=POSIX python2.5 testcase.py
LANG=sv_SE python2.5 testcase.py
Running the program like this should make it match both strings:
LANG=sv_SE.utf8 python2.5 testcase.py
Actual behaviour:
Running the program like this makes it match just the first string:
LANG=POSIX python2.5 testcase.py
LANG=sv_SE.utf8 python2.5 testcase.py
Running the program like this makes it match both strings:
LANG=sv_SE python2.5 testcase.py
So it's sort of reversed. Setting the locale to just sv_SE makes it
unicode aware, while setting it to sv_SE.utf8, which is an unicode
locale, makes it _not_ unicode aware.
---------------------------------------------------------------------------
!/usr/bin/python
import re
import locale
locale.setlocale(locale.LC_ALL, '')
r=re.compile(r"^\w", re.LOCALE)
l1=u"a"
l2=u"\u00E5" # LATIN SMALL LETTER A WITH RING ABOVE
if r.search(l1):
print "l1 matches"
if r.search(l2):
print "l2 matches"
-----------------------------------------------------------------------------
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.58
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Versions of packages python2.5 depends on:
ii libbz2-1.0 1.0.3-6 high-quality block-sorting file co
ii libc6 2.3.6.ds1-13etch4 GNU C Library: Shared libraries
ii libdb4.4 4.4.20-8 Berkeley v4.4 Database Libraries [
ii libncursesw5 5.5-5 Shared libraries for terminal hand
ii libreadline5 5.2-2 GNU readline and history libraries
ii libsqlite3-0 3.3.8-1.1 SQLite 3 shared library
ii libssl0.9.8 0.9.8c-4etch1 SSL shared libraries
ii mime-support 3.39-1 MIME files 'mime.types' & 'mailcap
ii python2.5-minimal 2.5-5 A minimal subset of the Python lan
python2.5 recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]