[SciPy-dev] Some Q's vis-a-vis Numpy unicode support
Tue Aug 11 19:41:33 CDT 2009
On Tue, Aug 11, 2009 at 7:49 PM, David Goldsmith<email@example.com> wrote:
> OK, may have answered Q1 myself: unless I'm misunderstanding what I'm seeing, what I'm finding is that capitalize() does nothing at all if the chararray is of dtype unicode - correct? Thanks,
> --- On Tue, 8/11/09, David Goldsmith <firstname.lastname@example.org> wrote:
>> From: David Goldsmith <email@example.com>
>> Subject: Some Q's vis-a-vis Numpy unicode support
>> To: firstname.lastname@example.org
>> Date: Tuesday, August 11, 2009, 4:02 PM
>> First, a "reality check" question:
>> 0) Is Windows (DOS) Terminal capable of rendering unicode?
not by default ( in US english at least)
but the code page number can be changed, which I never tried
Enable Windows to display an extended character set in graphics mode.
xxx Specifies a code page number.
/STATUS Displays the current code page selected for use with GRAFTABL.
from python session in windows command shell (it prints correctly in
case mail doesn't render it)
>>> print u'\xe9'
>>> print u'\xe9'.capitalize()
but I cannot print any numpy.chararrays without getting
>>> c= np.array(u'\xe9','<U1')
>>> print c
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 0: ordinal not in range(128)
(this is in Idle, with cp1252 I think)
the usual encode, decode problems with unicode, which take several
hours of trial and error and reading docs to figure out.
>> Unless the answer is "No," my real question:
>> 1) Does chararray.capitalize() capitalize non-Roman letters
>> that have different lower-case and upper-case forms (e.g.,
>> the Greek letters)? If "yes," are there any exceptions
>> (e.g., Russian letters)?
> Scipy-dev mailing list
More information about the Scipy-dev