#!/usr/bin/env python
# -*- coding: utf-8 -*-
import MySQLdb
conn = MySQLdb.connect('localhost', 'django_user', 'haha123', 'mydb')
cur = conn.cursor()
f = open('/home/kave/projects/cb/database/country_code_drupal_nov_2011.txt')
cur.execute("INSERT INTO myapp_app_currency (currency) VALUES ('USD - $'),('EUR - €'), ('GBP - £'), ('CAD - $'), ('AUD - $'), ('BRL - R$');")
出于某种原因,我可以成功地将这些数据插入到我的数据库中,但是有两个条目被损坏。
EUR - € becomes EUR - €
GBP - £ becomes GBP - £
我以为我已经将它设置为 utf8 并且它应该滚动,为什么只有这两个字符有问题?