ubuntu mysql emma中国語文字化けし問題解決


ubuntu mysql  emma        
 
emma   apt-get     ,emma       ,         emma     (python)。
apt-get  emma
sudo apt-get install emma 
 
ubuntu apt-get   emma  /usr/share/emma    。
cd /usr/share/emma/emmalib  
sudo vim __init__.py  
  
"db_encoding": "latin1"  
  
"db_encoding": "utf8"  

    。

              emma,       ~/.emma/emmarc  ,    。             ,         emma python   。
vim ~/.emma/emmarc   
  
db_encoding=latin1  
  
db_encoding=utf8  


  

sudo vim /usr/share/emma/emmalib/mysql_host.py  



  155    _use_db(self, name, do_query=True)    ,    
def _use_db(self, name, do_query=True):  
        if self.current_db and name == self.current_db.name: return  
        if do_query:   
                self.query("use `%s`" % name, False)  
                self.query("set names utf8",  False)  
        try:  
                self.current_db = self.databases[name]  
        except KeyError:  
                print "Warning: used an unknown database %r! please refresh host!/n%s" % (name, "".join(traceback.format_stack()))