So, I created this system a long time ago and is currently outputting Latin1 (ISO-8859-1) to a web browser, and these are the components:
MySQL - all data is stored with the Latin1 character set
PHP - all PHP text files are stored on a Latin1 encoded disk
HTML The output is a meta tag http-equiv = "content-type" content = "text / html; charset = iso-8859-1"
So, I'm trying to understand how the coding of different parts comes into play in my workflow. If I open a PHP script and change its encoding in a text editor to UTF-8 and save it to disk and reload the web browser, the text will be corrupted - if the text does not come from the database. If I changed the database encoding to UTF-8 and saved the PHP files in latin1, I must use utf8_decode () so that the data is displayed correctly. And if I change the HTML code, the browser will not read it correctly.
So, I understand that if I want to “upgrade” to UTF8, I need to update all three parts of this installation so that it works correctly, but since it is a huge system with 180k lines of PHP code and millions of messages in many databases / tables, I I don’t want to start something like this without understanding everything correctly.
What didn’t I think about? What could hinder this decision? What are the procedures for changing the encoding of an entire MySQL installation and what is an easy way to change the encoding of hundreds or thousands of PHP files on disk?
For example, the META label is added dynamically, so I will change it only in one place :)
Let me tell you about your experience with this.
source
share