fpdb/pyfpdb
Mika Bostrom 3b1e67e78b Store names as UTF-8
The names should be always in UTF-8 encoding. At least for PostgreSQL
the encdoding of the database comes from the time of running 'initdb'
(which is different from 'createdb') and if the encoding was selected or
set to something else at that time, the following error will occur:

  File ".../pyfpdb/Database.py", line 1630, in <lambda>
    self.pcache = LambdaDict(lambda  key:self.insertPlayer(key, siteid))
  File ".../pyfpdb/Database.py", line 1661, in insertPlayer
    c.execute (q, (site_id, _name))
  File "/usr/lib/python2.5/encodings/iso8859_15.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2122' in
position 10: character maps to <undefined>

This happens because 'name' is a regular string as opposed to a valid
unicode object. By forcing the string to unicode and encoding it in
UTF-8 the error goes away. In my case the database encoding was
ISO-8859-15 (latin9) but any other "wrong" encoding would trigger the
same problem.

This is a relatively common problem in python.
2009-12-24 09:52:47 +02:00
..
regression-test-files Add test hand - Hand cancelled 2009-12-17 15:59:29 +08:00
AbsoluteToFpdb.py Remove BOM from AbsoluteToPoker.py 2009-09-06 22:40:27 +08:00
Anonymise.py Add a HH anonymiser 2009-12-03 17:26:40 +08:00
BetfairToFpdb.py clarify where some logged or printed messages were coming from exactly 2009-11-03 13:56:26 -05:00
CarbonToFpdb.py clarify where some logged or printed messages were coming from exactly 2009-11-03 13:56:26 -05:00
Card.py [NEWIMPORT] HandsPlayers.startCards 2009-12-22 17:30:49 +08:00
Cards01.png Signed-off-by: fpdb-mme <jUrner@arcor.de> 2009-10-25 00:13:35 +02:00
Cards0-HMHUD.png new cards file 2009-03-10 20:31:09 -04:00
Configuration.py Add LOCALE static to Configuration 2009-12-22 13:49:22 +08:00
Database.py Store names as UTF-8 2009-12-24 09:52:47 +02:00
DatabaseManager.py remove all occurences of assigning sys.argv 2009-11-22 16:40:56 -05:00
DerivedStats.py [NEWIMPORT] Add function to update hudcache for Hand 2009-12-23 23:14:34 +08:00
EverleafToFpdb.py Fix cli to Everleaf 2009-10-29 16:37:33 +08:00
Exceptions.py show message dialog if pg connect fails 2009-12-12 09:51:07 +00:00
Filters.py Fix loal variable scope bug 2009-12-16 20:04:10 +08:00
fpdb_db.py [NEWIMPORT] Remove legacy code. 2009-12-22 14:44:35 +08:00
fpdb_import.py [NEWIMPORT] updateHudCache update. 2009-12-24 01:12:39 +08:00
fpdb.py Merge branch 'master' of git://repo.or.cz/fpbd-bostik 2009-12-14 16:47:10 +08:00
FpdbSQLQueries.py Signed-off-by: fpdb-mme <jUrner@arcor.de> 2009-10-25 00:13:35 +02:00
FulltiltToFpdb.py mostly None checkings fixed (== to is != to is not) 2009-11-03 14:30:52 -05:00
GuiAutoImport.py add textview to autoimport window for dropping status/info messages on, just call it's AddText func to get it there 2009-11-29 23:52:36 -05:00
GuiBulkImport.py [NEWIMPORT] Remove legacy code. 2009-12-22 14:44:35 +08:00
GuiGraphViewer.py allow legend box to work in python 2.5 2009-12-03 20:20:42 +00:00
GuiLogView.py logviewer: avoid memory-mapped files, make it work when opened a second time 2009-12-09 21:58:56 +00:00
GuiPlayerStats.py Fix Playerstats for Pot Limit 2009-11-21 11:16:08 +08:00
GuiPositionalStats.py make positional stats use Database.py 2009-07-19 18:28:13 +01:00
GuiPrefs.py add name to nodes 2009-12-12 12:09:58 +00:00
GuiSessionViewer.py mostly None checkings fixed (== to is != to is not) 2009-11-03 14:30:52 -05:00
GuiTableViewer.py [NEWIMPORT] Remove legacy code. 2009-12-22 14:44:35 +08:00
Hand.py [NEWIMPORT] Add function to update hudcache for Hand 2009-12-23 23:14:34 +08:00
HandHistory.py Signed-off-by: fpdb-mme <jUrner@arcor.de> 2009-10-25 00:13:35 +02:00
HandHistoryConverter.py [NEWIMPORT] Make seek into autoimport function 2009-12-22 21:40:37 +08:00
Hello.py Added Hello_Seats to Hello.py. Demo of Aux_Seats class. 2009-06-30 11:45:14 -04:00
HUD_config.test.xml Make test file use real database. 2009-12-06 22:56:29 +08:00
HUD_config.xml.example Add PartyPoker 10 seat hud layout to example file 2009-12-17 00:12:53 +08:00
HUD_main.py Merge branch 'master' of git://repo.or.cz/fpbd-bostik 2009-12-07 12:10:43 +08:00
HUD_run_me.py now sample code it works as expected 2009-11-05 01:26:32 +01:00
Hud.py comment out some prints, apparently mysqlcoder and my editors do not agree well with each other on spacing. 2009-12-03 07:24:12 -05:00
interlocks.py fix: according to doctests os_independend_kill() is supposed to return None 2009-11-01 09:58:14 +01:00
logging.conf create gui option to view the log 2009-12-05 15:54:49 +00:00
makeexe.bat add bat/py for making an exe. exe errors with "can't find module cairo". no idea how to fix. 2009-08-04 16:20:14 -04:00
makeexe.py add bat/py for making an exe. exe errors with "can't find module cairo". no idea how to fix. 2009-08-04 16:20:14 -04:00
Mucked.py mostly None checkings fixed (== to is != to is not) 2009-11-03 14:30:52 -05:00
OnGameToFpdb.py Add additional siteids to db, move player select function 2009-06-01 17:14:31 +08:00
Options.py Repair recent damage to Options 2009-12-03 16:46:10 +08:00
PartyPokerToFpdb.py PartyPoker - No Disconnect fix 2009-12-21 09:21:41 +08:00
PokerStarsToFpdb.py PokerStarsToFpdb - Add comment on parsing tourney buy-in 2009-12-21 16:10:44 +08:00
py2exe_setup.py Get logging.conf and matplotlib datafiles. 2009-11-09 22:02:50 -05:00
SQL.py [NEWIMPORT] Add function to update hudcache for Hand 2009-12-23 23:14:34 +08:00
Stats.py mostly None checkings fixed (== to is != to is not) 2009-11-03 14:30:52 -05:00
SummaryEverleaf.py add "rebuy" button to TT 2009-08-21 00:48:26 -05:00
Tables_Demo.py Yet another try to fix missing X windows. Using xwininfo. 2009-11-16 15:35:58 -05:00
Tables.py Remove reference to fpdb_simple 2009-12-22 20:22:05 +08:00
TableWindow.py Moved window title re to HHC classes 2009-11-07 20:30:47 +03:00
test_Betfair.py Add PLO test file for Betfair, update test to import it 2009-12-03 17:45:04 +08:00
test_Database.py Remove forced assert 2009-11-25 10:27:54 +08:00
test_Everleaf.py Make determineGameType return 'tour' of currency is T$ 2009-03-13 18:45:15 +09:00
test_FullTilt.py FulltiltToFpdb handles canceled hands 2009-08-09 15:19:43 +01:00
test_PokerStars.py Add test for Stars sawShowdown. 2009-12-06 22:57:27 +08:00
test1.py add simple test scripts for python and gtk 2009-12-06 14:17:22 +00:00
test2.py add simple test scripts for python and gtk 2009-12-06 14:17:22 +00:00
TournamentTracker.py add ability to display hud stats by number of seats at table (All / Custom / Exact) 2009-11-26 21:28:05 +00:00
Tourney.py Last part of core tourney import 2009-09-04 02:01:41 +02:00
UltimateBetToFpdb.py Add index parameter to Plugins 2009-07-17 17:45:22 +08:00
upd_indexes.sql Signed-off-by: fpdb-mme <jUrner@arcor.de> 2009-10-25 00:13:35 +02:00
Win2dayToFpdb.py FulltiltToFpdb handles canceled hands 2009-08-09 15:19:43 +01:00
windows_make_bats.py merge from carl 2009-08-02 07:14:31 -04:00
WinTables.py stuck an error print in wintables if self.window doesn't exist 2009-11-23 10:24:38 -05:00
XTables.py Yet another try to fix missing X windows. Using xwininfo. 2009-11-16 15:35:58 -05:00