I have a PHP application who's files encoding is Greek ISO (iso-8859-7). I want to convert the files to utf-8 but simply saving the files with utf-8 isn't enough since the Greek texts get garbled. Is there an "automatic" method to do this so that I can completely convert my app's encoding without having to go through each file and rewrite the texts?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Try the iconv function
On a Linux system, if you are sure all files are currently encoded in ISO-8859-7, you can do this:
This converts all PHP script files located in
/your/path
as well as all sub-directories. Remove-name "*.php"
to convert all files.Since you are under Windows, the easiest option would be a PHP script like this:
The following code should work for you, it's a PowerShell script, you can
Start > Run > powershell
and paste code after modifying required lines.You may remove
#
char on line 6 to make some replacements before saving.