Many thanks, it works when setting the LANG environment variable.
BTW:
For Windows users, when running Python command-line programs,
you can also modify the properties of the cmd.exe window and
tell windows to use the TT Lucida Console font instead of the raster
font.
Then, before starting the
Helmut Jarausch [EMAIL PROTECTED] wrote:
# but this ugly one (to be done for each output file)
sys.stdout._encoding='latin1'
Is this writable _encoding attribute, with a leading underscore (_),
documented anywhere? Does it actually work? Would it happen to be
supported in 2.5 or 2.6? The fact
Ross Ridge wrote:
Helmut Jarausch [EMAIL PROTECTED] wrote:
# but this ugly one (to be done for each output file)
sys.stdout._encoding='latin1'
Is this writable _encoding attribute, with a leading underscore (_),
documented anywhere? Does it actually work? Would it happen to be
supported in
Martin v. Löwis wrote:
What defines me as latin1-user?
That your locale is based on Latin-1, e.g. because it is a German
locale. How precisely that works depends on the operating system.
So my system seems to be an ASCII system?
At least that's what Python determined. If Python couldn't
Still, I wished it were possible call sys.setdefaultencoding
at the very beginning of a script.
Why isn't that possible?
The default encoding was used when combining byte-oriented
text and unicode-oriented text. Such combination is no longer
supported, hence the notion of a default encoding
Martin v. Löwis wrote:
Still, I wished it were possible call sys.setdefaultencoding
at the very beginning of a script.
Why isn't that possible?
The default encoding was used when combining byte-oriented
text and unicode-oriented text. Such combination is no longer
supported, hence the notion
On 16 Okt, 11:28, Helmut Jarausch [EMAIL PROTECTED]
wrote:
I meant setting the default encoding which is used by print (e.g.) when
outputting the internal unicode string to a file.
As far as I understood, currently I am fixed to setting either
the 'locale' or to switch settings for each
Paul Boddie wrote:
On 16 Okt, 11:28, Helmut Jarausch [EMAIL PROTECTED]
wrote:
I meant setting the default encoding which is used by print (e.g.) when
outputting the internal unicode string to a file.
As far as I understood, currently I am fixed to setting either
the 'locale' or to switch
I meant setting the default encoding which is used by print (e.g.) when
outputting the internal unicode string to a file.
Having such a thing would be conceptually wrong. What encoding should
be used depends on the file - different files may have different
encodings. When opening a file, you
Helmut Jarausch wrote:
I have always worked with latin-1 strings with an US locale under
python-2.x with x 6 (I haven't tried 2.6, though). I hope to switch to
3.0 as soon as possible.
Having the luxury of not needing 3rd party extensions for my current
work, I already have, and love it.
Ben Finney wrote:
Helmut Jarausch [EMAIL PROTECTED] writes:
I have to set an internal property (with leading underscore)
for each output file I'm using - right?
If you're referring to the source encoding declaration: No,
underscores have no effect. The specification is at
On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED]
wrote:
What defines me as latin1-user?
What does sys.stdout.encoding say? In Python 2.x, at least, that
attribute should reflect the capabilities of your environment
(specifically, the character encoding) and help determine whether it
makes
Paul Boddie wrote:
On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED]
wrote:
What defines me as latin1-user?
What does sys.stdout.encoding say? In Python 2.x, at least, that
It says ansi_x3.4-1968
Where can I change this?
attribute should reflect the capabilities of your environment
On 15 Okt, 17:59, Helmut Jarausch [EMAIL PROTECTED] wrote:
Paul Boddie wrote:
What does sys.stdout.encoding say? In Python 2.x, at least, that
It says ansi_x3.4-1968
That's ASCII, yes.
Where can I change this?
What's your locale? I can provoke the same setting if I run a Python
program
Helmut Jarausch wrote:
Paul Boddie wrote:
On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED]
wrote:
What defines me as latin1-user?
What does sys.stdout.encoding say? In Python 2.x, at least, that
It says ansi_x3.4-1968
Where can I change this?
By changing your console's terminal
I would just use UTF-8 and be done with it.
Set your editor to write UTF-8 files, set the correct #coding at your
python script, make sure your terminal supports outputting UTF-8
characters (and your font has the correct glyphs) and everything
should be fine. No trickery required.
Even
Martin v. Löwis wrote:
do I miss something (I do hope so) or is switching to Python3
really hard for Latin1-users?
Why do you want to switch? sys.stdout.encoding should already be
iso-8859-1, if you are a Latin1-user.
What defines me as latin1-user?
commenting
#
Brian Quinlan wrote:
Hey Helmut,
Did you try just:
print(Hallo, Süßes Python)
Yes, but that doesn't work here.
Please see my reply to Martin's reply.
Thanks,
Helmut.
--
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
--
What defines me as latin1-user?
That your locale is based on Latin-1, e.g. because it is a German
locale. How precisely that works depends on the operating system.
So my system seems to be an ASCII system?
At least that's what Python determined. If Python couldn't have found
out that you
Hi,
do I miss something (I do hope so) or is switching to Python3
really hard for Latin1-users?
My simplest hello world script - which uses a few German
umlaut characters - doesn't look very intuitive.
I have to set an internal property (with leading underscore)
for each output file I'm using -
Hi Helmut, All,
do I miss something (I do hope so) or is switching to Python3
really hard for Latin1-users?
It's as complicated as ever -- if you have used unicode strings
in the past (as the 3.0 strings now are always unicode strings).
# sys.setfilesystemencoding('latin1')
This cares about
do I miss something (I do hope so) or is switching to Python3
really hard for Latin1-users?
Why do you want to switch? sys.stdout.encoding should already be
iso-8859-1, if you are a Latin1-user.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Hey Helmut,
Did you try just:
print(Hallo, Süßes Python)
Cheers,
Brian
Helmut Jarausch wrote:
Hi,
do I miss something (I do hope so) or is switching to Python3
really hard for Latin1-users?
My simplest hello world script - which uses a few German
umlaut characters - doesn't look very
Helmut Jarausch [EMAIL PROTECTED] writes:
I have to set an internal property (with leading underscore)
for each output file I'm using - right?
If you're referring to the source encoding declaration: No,
underscores have no effect. The specification is at
24 matches
Mail list logo