views:

119

answers:

1

I have a scrolling LED sign that takes messages in either ASCII or (using some specific code) characters from a custom code page.

For example, the euro sign should be sent as

<U00>

and ä is

<U64>

(You can find the full code page in the documentation)

My question is, what is the most pythonic way to implement this custom code page, and to have a codec that can convert UTF strings to my custom code page ?

+2  A: 
  1. Pick a name for your encoding, maybe "led_display", whatever.
  2. Implement and register a codec with the standard library.
  3. Pythonic profit!
ddaa