Changeset 1790 for pykota/trunk/bin

Show
Ignore:
Timestamp:
10/07/04 23:14:28 (20 years ago)
Author:
jalet
Message:

Hopefully final fix for data encoding to and from the database

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/dumpykota

    r1789 r1790  
    2424# 
    2525# $Log$ 
     26# Revision 1.12  2004/10/07 21:14:28  jalet 
     27# Hopefully final fix for data encoding to and from the database 
     28# 
    2629# Revision 1.11  2004/10/07 14:35:40  jalet 
    2730# Now edpykota refuses to launch if the user is not a PyKota administrator. 
     
    234237            x.entry() 
    235238            for i in range(len(entry)) : 
    236                 value = entry[i] 
    237                 strvalue = unicode(str(value), self.getCharset()).encode("UTF-8") 
    238                 x.attribute(strvalue, type=type(value).__name__, name=headers[i]) 
     239                value = str(entry[i]) 
     240                try : 
     241                    value = unicode(value, self.getCharset()).encode("UTF-8") 
     242                except UnicodeError :     
     243                    pass 
     244                x.attribute(value, type=type(value).__name__, name=headers[i]) 
    239245            x._pop()     
    240246        x._output(self.outfile)