简体   繁体   English

将 UTF-8 重音转换为格式错误的 ISO 重音

[英]Convert UTF-8 accents to malformed ISO accents

I'm in an UTF-8 project.我在一个 UTF-8 项目中。 I have data from an old ISO project where accents are bad encoded (é,è...), I don't want to convert the ISO data but I need to match some data between the 2 databases.我有来自旧 ISO 项目的数据,其中重音编码错误(é,è...),我不想转换 ISO 数据,但我需要匹配两个数据库之间的一些数据。

So I got to transform a "é" into a "é" (and so on..)所以我必须将“é”转换为“é”(等等..)

I tried to convert to ISO but I never succeeded to obtain the weird encodage.我试图转换为 ISO,但我从未成功获得奇怪的编码。

Is there a way to convert these accents while staying in UTF-8 file encodage?有没有办法在 UTF-8 文件编码中转换这些口音?

It really depends on which ISO encoding you were working with, but to (invalidly) "downgrade" from UTF-8 you could trying something like mb_convert_encoding('é', 'UTF-8', 'ISO-8859-1') , demo here这实际上取决于您使用的是哪种 ISO 编码,但是要(无效地)从 UTF-8 “降级”,您可以尝试类似mb_convert_encoding('é', 'UTF-8', 'ISO-8859-1')东西,这里是演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM