latin-1到utf-8数据库 [英] latin-1 to utf-8 database

查看:232
本文介绍了latin-1到utf-8数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库是uft8_general_ci,只有问题到此为止,以前的开发人员编码的应用程序似乎一直在使用拉丁文数据库1。



自从我改变了应用程序如何使用数据库,现在可以存储一个变音符作为一个变音符,而不是¼。现在的问题是,应用程序从数据库中读取以前存在的数据(例如)'Süddeutsche'而不是'Süddeutsche'。



是否有转换数据



编辑:

  ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET latin1; 
ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET binary;
ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET utf8;

这对我有用。

解决方案

http://blog.hno3.org/2010/04/22/fixing-double-encoded-utf-8-data-in-mysql/



使用这里列出的已经修复了我的所有问题。我用这个与我的实时数据,没有问题!


I have a database that is uft8_general_ci, only problem is up until this point an application coded by a previous developer seems to have been working with the database in latin-1.

I have since changed how the app uses the database and can now store an umlaut as an umlaut instead of ü. The problem now is that the application reads the previously existing data from the database as (example) 'Süddeutsche' instead of 'Süddeutsche'.

Is there anyway to convert the data inside the database from one format to the other?

Regards

Edit:

ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET latin1;
ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET binary;
ALTER TABLE TableName MODIFY ColumnName ColumnType CHARACTER SET utf8;

This worked for me.

解决方案

http://blog.hno3.org/2010/04/22/fixing-double-encoded-utf-8-data-in-mysql/

Using what is listed here has fixed all my problems. I used this with my live data and have had no issues!

这篇关于latin-1到utf-8数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆