【发布时间】:2012-03-22 15:52:47
【问题描述】:
我每晚从一个以拉丁文存储字段的网络服务获取数据,但我的数据库是 utf8 格式。 更新或插入记录时是否可以将数据字符串转换为utf8?
【问题讨论】:
标签: php mysql unicode encoding
我每晚从一个以拉丁文存储字段的网络服务获取数据,但我的数据库是 utf8 格式。 更新或插入记录时是否可以将数据字符串转换为utf8?
【问题讨论】:
标签: php mysql unicode encoding
$output = utf8_encode ( $inputstring );
阅读更多关于utf8_encode
【讨论】:
看看 PHP 中的多字节字符串函数提供的功能。具体来说,我认为mb_convert_encoding 是您正在寻找的功能。
$output = mb_convert_encoding ($input, 'UTF-8', 'ISO-8859-1');
根据Wikipedia,ISO-8859-1 是“Latin-1”的官方编码标准。
【讨论】: