bastienleonard / pysfml-cython

A Python 2/3 binding for SFML 2, written with Cython
http://pysfml2-cython.readthedocs.org/
Other
68 stars 8 forks source link

Use default_encoding in Text.string and Text's constructor #35

Open bastienleonard opened 12 years ago

bastienleonard commented 12 years ago

Currently, when a Text object is created with a bytes object, it calls the underlying C++ constructor with the same bytes, which SFML will interpret as an “ANSI string” (cp1252 encoding). It would probably make more sense to decode the bytes with the sfml.default_encoding attribute, especially since ANSI strings are barely used outside of the Windows world.

On the other hand, this could slow down the API, even when the user is only using ASCII characters.