0

I'm in an UTF-8 project. 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.

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.

Is there a way to convert these accents while staying in UTF-8 file encodage ?

jiboulex
  • 2,963
  • 2
  • 18
  • 28
  • 1
    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')`. You can see it here: https://3v4l.org/3TIWI – Chris Haas Jun 07 '21 at 18:42
  • Oh ! Thank you Chris, this is what I was looking for ! You can submit it as an answer so I can flag this question as solved ! Thank you again ! – jiboulex Jun 07 '21 at 19:43
  • 1
    https://stackoverflow.com/questions/279170/utf-8-all-the-way-through – Sammitch Jun 07 '21 at 23:11

1 Answers1

1

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

Chris Haas
  • 53,986
  • 12
  • 141
  • 274