1

I have the following problem:

I used the filezilla application to get the files of a page through FTP to backup them in case it needs to be restored later.

If it were to restore the site with the files obtained by FTP, the problem was that the files were UTF-8 encoded and when they were downloaded they became ANSI. When I restore the files I replace the UTF-8's with the ANSI's and now I get syntax errors everywhere.

Is there any way to reverse the conversion from UTF-8 to ANSI without the loss of data?

Fragment of one of the files with the problem:

"italic" => "http://fonts.gstatic.com/s/almendra/v11/H4ciBXK@ 

Error shown:

Parse error: syntax error, unexpected '@', expecting ')' in
... / Avada / includes / lib / inc / redux / custom-fields / typography / googlefonts-array.php
on line 3

Process to prevent the problem:

http://chaosrequiem.com/main/problema-comun-al-subir-archivos-con-filezilla/

Thanks in advance

1 Answer 1

2

This is too late : The characters have been destroyed.

The problem is exactly the one described in your link: Your files were encoded in UTF-8 which uses 8 bits per byte. You have transferred them as ANSI, which is only 7 bits per byte. What has happened is that all bytes were truncated to 7 bits, so that the upper bit was lost and became zero.

This is especially serious with UTF-8, because non-ANSI characters may be encoded in more than one byte, and when this happens to a multi-byte characters then each of the bytes becomes a separate character.

If you cannot get the old files back, maybe from an old backup, you will have to correct them manually. As the number of destroyed characters is limited, if you identify such characters, you might be able to use some utility for text-substitution to replace some sequences of characters with the original sequence in all the files in one operation.

This is manual work, but there is no other solution.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .