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-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 mar...@v.loewis.de 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

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 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 sure

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. Thorsten

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Giampaolo Rodola'
On 26 Gen, 19:16, jefm jef.mangelsch...@gmail.com 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

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' gne...@gmail.com 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

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, by your own

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread John Machin
On Jan 27, 11:52 pm, Giampaolo Rodola' gne...@gmail.com wrote: On 26 Gen, 19:16, jefm jef.mangelsch...@gmail.com 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/

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. print

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' gne...@gmail.com 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 Denis Kasak
On Tue, Jan 27, 2009 at 7:08 PM, Thorsten Kampe thors...@thorstenkampe.de wrote: * Denis Kasak (Tue, 27 Jan 2009 14:22:32 +0100) On Tue, Jan 27, 2009 at 1:52 PM, Giampaolo Rodola' gne...@gmail.com wrote: snip print unicode('\u20ac') \u20ac Shouldn't this be print unicode(u'\u20ac')

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 hollow-square .

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 mar...@v.loewis.de 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

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 sjmac...@lexicon.net wrote: On Jan 27, 6:17 pm, Martin v. Löwis mar...@v.loewis.de 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

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 mar...@v.loewis.de 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-circumflex

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 sjmac...@lexicon.net escribió: On Jan 28, 5:56 am, Martin v. Löwis mar...@v.loewis.de 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))

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 gagsl-...@yahoo.com.arwrote: En Wed, 28 Jan 2009 00:03:55 -0200, John Machin sjmac...@lexicon.net escribió: On Jan 28, 5:56 am, Martin v. Löwis mar...@v.loewis.de wrote: #include stdio.h int main(int argc, char **argv) {

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

[issue5081] Unable to print Unicode characters in Python 3 on Windows

2009-01-27 Thread Giampaolo Rodola'
-- components: None messages: 80650 nosy: giampaolo.rodola severity: normal status: open title: Unable to print Unicode characters in Python 3 on Windows type: crash versions: Python 3.0, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5081

[issue5081] Unable to print Unicode characters in Python 3 on Windows

2009-01-27 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Your 2.6 example is incorrect. Try py print u'\u20ac' If you want the 3.0 equivalent of your 2.6 code: it is py print(r'\u20ac') \u20ac Closing this as works for me. -- nosy: +loewis resolution: - works for me status: open -

unable to print Unicode characters in Python 3

2009-01-26 Thread jefm
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 supposedly allows me to specify the Unicode

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 jefm

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 jef.mangelsch...@gmail.com 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/

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 ? --

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 said,

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

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. But

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 jef.mangelsch...@gmail.com 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

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 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. --

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread John Machin
On Jan 27, 8:38 am, Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 26 Jan 2009 13:26:56 -0800 (PST), jefm jef.mangelsch...@gmail.com 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

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 see

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 John Machin
On Jan 27, 10:00 am, Martin v. Löwis mar...@v.loewis.de 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

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 mar...@v.loewis.de 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,

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 mar...@v.loewis.dewrote: 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

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