pygame.event returns incorrect unicode for euro sign

Issue #3 invalid
René Dudfield created an issue

== Robin Allen, 2008-01-17 01:57:02 -0800

{{{ import pygame, unicodedata

pygame.init() pygame.display.set_mode((150, 150))

print "ESC to quit" print "Euro sign should be", hex(ord(u'\N{EURO SIGN}'))

while True: evt = pygame.event.wait() if evt.type == pygame.KEYDOWN: if evt.key == pygame.K_ESCAPE: break elif evt.unicode: print "%s (%s)" % (hex(ord(evt.unicode)),, "NO NAME"))

-- If you run this script and type a Euro sign, you can see that pygame gives its unicode value as 0x80 (An unnamed Unicode 'control' character /sometimes/ rendered with a Euro sign) instead of 0x20AC (Unicode "EURO SIGN"). }}}

== illume, 2008-05-02 16:20:49 -0700

{{{ I don't have a euro sign on my keyboard to test this. }}}

== jmm0, 2010-12-02 06:31:07 -0800

{{{ I tried the example code on my workstation. 0x20AC (Unicode "EURO SIGN") was printed to the console as expected when I pressed RightAlt + E.

OS: Windows XP Professional (32-bit) Keyboard service: French (France) Python: 2.4 pygame: 1.9.2pre-svn2952 }}}

== Herman Chau, 2010-12-20 04:08:06 -0800

{{{ I also tried running the script and it gave the correct output: 0x20AC (Unicode "EURO SIGN")

OS: Ubuntu 10.04 Python: 2.6.5 Pygame: 1.9.1 }}}

== Dávid Gábor Bodor, 2011-07-24 02:51:24 -0700

{{{ Tested on 1.9.1 and svn-3193, both produces the correct result.

The code for the euro sign is 0x20AC for me as expected. I have a hungarian keyboard, the combination is AltGr-U. }}}

Comments (1)

  1. René Dudfield reporter

    Marking as resolved as no one else can reproduce this problem.

    Please reopen the issue if the issue still exists. Also, if reopening please report information about OS version keyboard type, and as much other information you can think of.


  2. Log in to comment