Re: unable to print Unicode characters in Python 3

2009-01-28 Thread Ross Ridge
John Machin writes: > The only font choice offered apart from "Raster Fonts" in the Command > Prompt window's Properties box is "Lucida Console", not "Lucida Sans > Unicode". It will let me print Cyrillic characters from a C program, > but not Chinese. I'm off looking for how to get a better font.

Re: unable to print Unicode characters in Python 3

2009-01-28 Thread Martin v. Löwis
> Big step. I don't have Visual Studio and have never used it before. > Which version of VS do I need to debug which released version of Python > 2.X and where do I get that VS from? Or do I need to build Python from > source to be able to debug it? You need Visual Studio 2008 (Professional, not s

Re: unable to print Unicode characters in Python 3

2009-01-28 Thread jefm
this is alink explaining how to add new fonts to the command line (e.g. Lucida Sans Unicode) http://phatness.com/node/1643 -- http://mail.python.org/mailman/listinfo/python-list

Re: unable to print Unicode characters in Python 3

2009-01-28 Thread Thorsten Kampe
* John Machin (Tue, 27 Jan 2009 18:03:55 -0800 (PST)) > On Jan 28, 5:56 am, "Martin v. Löwis" wrote: > The only font choice offered apart from "Raster Fonts" in the Command > Prompt window's Properties box is "Lucida Console", not "Lucida Sans > Unicode". It will let me print Cyrillic characters f

Re: unable to print Unicode characters in Python 3

2009-01-28 Thread John Machin
On 28/01/2009 6:32 PM, Martin v. Löwis wrote: Next step? You need to use the Visual Studio debugger to find out where precisely the IOError comes from. Big step. I don't have Visual Studio and have never used it before. Which version of VS do I need to debug which released version of Python

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Martin v. Löwis
> Next step? You need to use the Visual Studio debugger to find out where precisely the IOError comes from. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Benjamin Kaplan
On Tue, Jan 27, 2009 at 9:16 PM, Gabriel Genellina wrote: > En Wed, 28 Jan 2009 00:03:55 -0200, John Machin > escribió: > > On Jan 28, 5:56 am, "Martin v. Löwis" wrote: >> >>> > #include "stdio.h" >>> > int main(int argc, char **argv) { >>> > printf("<\xc2\x80>\n"); >>> > } >>> >>> > co

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Gabriel Genellina
En Wed, 28 Jan 2009 00:03:55 -0200, John Machin escribió: On Jan 28, 5:56 am, "Martin v. Löwis" wrote: > #include "stdio.h" > int main(int argc, char **argv) { >     printf("<\xc2\x80>\n"); >     } > compiled with mingw32 (gcc (GCC) 3.4.5 (mingw-vista special r3)) > and using "Lucida Console

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread John Machin
On Jan 28, 5:56 am, "Martin v. Löwis" wrote: > > #include "stdio.h" > > int main(int argc, char **argv) { > >     printf("<\xc2\x80>\n"); > >     } > > > compiled with mingw32 (gcc (GCC) 3.4.5 (mingw-vista special r3)) > > and using "Lucida Console" font: > > > After CHCP 1252, this prints < A-cir

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Benjamin Kaplan
On Tue, Jan 27, 2009 at 7:41 PM, John Machin wrote: > On Jan 27, 6:17 pm, "Martin v. Löwis" wrote: > > > Well, the first step would be to tell Python that there is a code page > > > 65001. On Python 2.6, I get a LookupError for an unknown encoding after > > > doing "chcp 65001". I checked the li

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread John Machin
On Jan 27, 6:17 pm, "Martin v. Löwis" wrote: > > Well, the first step would be to tell Python that there is a code page > > 65001. On Python 2.6, I get a LookupError for an unknown encoding after > > doing "chcp 65001". I checked the list of aliases in Python 3 and there > > was no entry for cp650

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Martin v. Löwis
> #include "stdio.h" > int main(int argc, char **argv) { > printf("<\xc2\x80>\n"); > } > > compiled with mingw32 (gcc (GCC) 3.4.5 (mingw-vista special r3)) > and using "Lucida Console" font: > > After CHCP 1252, this prints < A-circumflex Euro >, as expected. > After CHCP 65001, it prints

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Denis Kasak
On Tue, Jan 27, 2009 at 7:08 PM, Thorsten Kampe wrote: > * Denis Kasak (Tue, 27 Jan 2009 14:22:32 +0100) >> On Tue, Jan 27, 2009 at 1:52 PM, Giampaolo Rodola' >> wrote: >> print unicode('\u20ac') >> > \u20ac >> >> Shouldn't this be >> >> print unicode(u'\u20ac') > > You are trying to crea

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Thorsten Kampe
* Denis Kasak (Tue, 27 Jan 2009 14:22:32 +0100) > On Tue, Jan 27, 2009 at 1:52 PM, Giampaolo Rodola' > wrote: > > I have this same issue on Windows. > > Note that on Python 2.6 it works: > > > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > > (Intel)] on > > win32 > > Type

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Thorsten Kampe
* Giampaolo Rodola' (Tue, 27 Jan 2009 04:52:16 -0800 (PST)) > I have this same issue on Windows. > Note that on Python 2.6 it works: > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread John Machin
On Jan 27, 11:52 pm, "Giampaolo Rodola'" wrote: > On 26 Gen, 19:16, jefm wrote: > > > > > Hi, > > while checking out Python 3, I read that all text strings are now > > natively Unicode. > > In the Python language reference (http://docs.python.org/3.0/reference/ > > lexical_analysis.html) I read t

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Stephen Hansen
> > Note that on Python 2.6 it works: > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> print unicode('\u20ac') > \u20ac > Note that in Python 2.6 it expressly *does not* work

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Denis Kasak
On Tue, Jan 27, 2009 at 1:52 PM, Giampaolo Rodola' wrote: > I have this same issue on Windows. > Note that on Python 2.6 it works: > > Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information.

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Giampaolo Rodola'
On 26 Gen, 19:16, jefm wrote: > Hi, > while checking out Python 3, I read that all text strings are now > natively Unicode. > In the Python language reference (http://docs.python.org/3.0/reference/ > lexical_analysis.html) I read that I can show Unicode character in > several ways. > "\u" supp

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Martin v. Löwis
> Well, the first step would be to tell Python that there is a code page > 65001. On Python 2.6, I get a LookupError for an unknown encoding after > doing "chcp 65001". I checked the list of aliases in Python 3 and there > was no entry for cp65001. I see. What happens if you add it to encoding/ali

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Benjamin Kaplan
On Mon, Jan 26, 2009 at 5:42 PM, "Martin v. Löwis" wrote: > > I was hoping to find something that allows me to print any Unicode > > character on the console. > > You will have to debug the Python interpreter to find out what's > going wrong in code page 65001. Nobody has ever resolved that myster

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread John Machin
On Jan 27, 9:42 am, "Martin v. Löwis" wrote: > > I was hoping to find something that allows me to print any Unicode > > character on the console. > > You will have to debug the Python interpreter to find out what's > going wrong in code page 65001. Nobody has ever resolved that mystery, > although

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread John Machin
On Jan 27, 10:00 am, "Martin v. Löwis" wrote: > > IOW, the bridge might think it's in cp1252 mode, but nobody told the > > engine room, which is still churning out cp850. > > I think you must use a different font in the console, too, such as > Lucida Sans Unicode. True. I was just about to post t

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Martin v. Löwis
> IOW, the bridge might think it's in cp1252 mode, but nobody told the > engine room, which is still churning out cp850. I think you must use a different font in the console, too, such as Lucida Sans Unicode. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Martin v. Löwis
> I was hoping to find something that allows me to print any Unicode > character on the console. You will have to debug the Python interpreter to find out what's going wrong in code page 65001. Nobody has ever resolved that mystery, although it's been known for some time. If you merely want to se

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread John Machin
On Jan 27, 8:38 am, Jean-Paul Calderone wrote: > On Mon, 26 Jan 2009 13:26:56 -0800 (PST), jefm > wrote: > >>As Benjamin Kaplin said, Windows terminals use the old cp1252 character > >>set, which cannot display the euro sign. You'll either have to run it in > >> something more modern like the cy

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread jefm
chcp 1252 does allow me to print the EURO sign. Thanks for pointing that out. However, it does not show me some ALL Unicode characters. Very frustrating. I was hoping to find something that allows me to print any Unicode character on the console. -- http://mail.python.org/mailman/listinfo/python-li

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread jefm
Now that I know the problem, I found the following on Google. Windows uses codepages to display different character sets. (http:// en.wikipedia.org/wiki/Code_page) The Windows chcp command allows you to change the character set from the original 437 set. When you type on the command line: chcp

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Jean-Paul Calderone
On Mon, 26 Jan 2009 13:26:56 -0800 (PST), jefm wrote: As Benjamin Kaplin said, Windows terminals use the old cp1252 character set, which cannot display the euro sign. You'll either have to run it in something more modern like the cygwin rxvt terminal, or output some other way, such as through a

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread jefm
>As Benjamin Kaplin said, Windows terminals use the old cp1252 character >set, which cannot display the euro sign. You'll either have to run it in > something more modern like the cygwin rxvt terminal, or output some >other way, such as through a GUI. >With the standard console, I get the same. B

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Terry Reedy
jefm wrote: Hi, while checking out Python 3, I read that all text strings are now natively Unicode. True In the Python language reference (http://docs.python.org/3.0/reference/ lexical_analysis.html) I read that I can show Unicode character in several ways. "\u" supposedly allows me to sp

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Michael Torrie
jefm wrote: >> Hmm this works for me, >> it's a self compiled version: >> ~ $ python3 >> Python 3.0 (r30:67503, Dec 29 2008, 21:35:15) >> [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 > > You are running on Linux. Mine is on Windows. > Anyone else have this issue on Windows ? As Benjamin Kaplin

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread jefm
>Hmm this works for me, >it's a self compiled version: >~ $ python3 >Python 3.0 (r30:67503, Dec 29 2008, 21:35:15) >[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 You are running on Linux. Mine is on Windows. Anyone else have this issue on Windows ? -- http://mail.python.org/mailman/listinfo/pytho

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Benjamin Kaplan
On Mon, Jan 26, 2009 at 1:16 PM, jefm wrote: > Hi, > while checking out Python 3, I read that all text strings are now > natively Unicode. > In the Python language reference (http://docs.python.org/3.0/reference/ > lexical_analysis.html)

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Martin
Hmm this works for me, it's a self compiled version: ~ $ python3 Python 3.0 (r30:67503, Dec 29 2008, 21:35:15) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print("\u20ac") € >>> print ("\N{EURO SIGN}") € >>> 2009/1/26 j