Community   Maps   Forum   Mail   Ladders   Clans   Recent Games
Sign In | Sign Up
<< Back to Programming Forum   

Posts 1 - 1 of 1   
CLOT: Fix for non-ascii characters: 12/26/2012 20:14:09

Level 57

WarLight Creator
I just made a commit that should fix the problems that were coming up when non-ascii characters were used. If you're already working on a CLOT, you can merge my changes into yours by looking at this diff:

The main change is that you have to use the unicode() function instead of str().

This fixes most of the problems. But you also need to be careful when converting lists into strings. For example, say you have a list of players called "players". If you just do unicode(players), you'll still get an error with non-ascii characters because Python tries to call str() for each player.

Instead, the best fix I could find is to call unicode() on every single player individually and join them together, like this: ', '.join([unicode(p) for p in players])
Posts 1 - 1 of 1   

Contact | About WarLight | Play Risk Online | Multiplayer Strategy Game | Challenge Friends, Win Money | Skill Game | Terms of Service