Exchange Between UTF-8 and GBK -- solved with convertz Software

Source: Internet
Author: User

When writing PHP code and copying code from another file, garbled characters are generated due to different characters in the code.

Some interesting solutions are captured from the Internet and reproduced.

Using new string (Str. getbytes ("UTF-8"), "GBK"), UTF-8 cannot be converted to GBK

Urldecoder. Decode (urlencoder. encode (STR, "GBK"), "GBK "),

STR is a UTF-8 string, and the result is converted to GBK.

The stupid method is to use Dreamweaver for conversion. If one or two files are okay, the 100 or 200 files will be finished. So the best method is to directly use the code conversion software. The software I use is convertz. It seems that this software has not been updated since it was developed n years ago, but it is quite useful.

This software is free of installation, double-click convertz.exe. After the program is started, it will automatically hide to the top of the desktop, open the files you need, as shown in



Select the folder in which you want to convert the template. files ending with ".htm,.html" and ".txt" in the folder will appear in the view. Do not forget to set the directory of the converted document in the destination option. At this time, the advanced options may not have the conversion mode you need. For example, if you want to convert UTF-8 to GBK, click the advanced Options button and there will be the following options:


Select the input format and output format. Hide the advanced Options button and add the file you want to convert to the file list.

OK. Click Start conversion. The conversion will be completed soon.


Note: When the GBK template is converted to UTF-8, some punctuation points cannot be converted, and these GBK-encoded punctuation points cannot be displayed on foreign computers. Therefore, some files need to replace some unconvertible items in batches. Similarly, the Chinese website uses the uft-8 template is not pure UTF-8, want to translate into English template use do not forget which punctuation and symbols need to be modified.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.