Changeset 1762 for pykota/trunk

Show
Ignore:
Timestamp:
10/02/04 15:33:13 (20 years ago)
Author:
jalet
Message:

Some work done of user's charset handling in database dumps.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/sql.py

    r1761 r1762  
    2222# 
    2323# $Log$ 
     24# Revision 1.49  2004/10/02 13:33:13  jalet 
     25# Some work done of user's charset handling in database dumps. 
     26# 
    2427# Revision 1.48  2004/10/02 05:48:56  jalet 
    2528# Should now correctly deal with charsets both when storing into databases and when 
     
    7881# 
    7982 
     83from types import StringType 
    8084from pykota.storage import PyKotaStorageError,BaseStorage,StorageObject,StorageUser,StorageGroup,StoragePrinter,StorageJob,StorageLastJob,StorageUserPQuota,StorageGroupPQuota 
    8185 
     
    8690            entries = [result.listfields()] 
    8791            entries.extend(result.getresult()) 
     92            #nbfields = len(entries[0]) 
     93            #for i in range(1, len(entries)) : 
     94            #    fields = list(entries[i]) 
     95            #    for j in range(nbfields) : 
     96            #        field = fields[j] 
     97            #        if type(field) == StringType : 
     98            #            try : 
     99            #                fields[j] = field.decode("UTF-8").encode(self.tool.getCharset())  
     100            #            except UnicodeEncodeError : # takes care of old jobs in history not stored as UTF-8     
     101            #                pass 
     102            #    entries[i] = tuple(fields)     
    88103            return entries 
    89104