LR solves Chinese garbled characters (source--Baidu)

Source: Internet
Author: User

Because the Chinese operating system we use the default Chinese encoding format is GB2312, so LR to the server return content automatically use GB2312 way to read, but almost all Chinese sites are now in the use of UTF-8 way to encode, due to different decoding the way the encoding will eventually lead to Chinese processing errors.

For this coding problem, we can use the function lr_convert_string_encoding () function to handle it.

For example, we need to change the Chinese "portal" to UTF-8 format, so the code can write:

Lr_convert_string_encoding (

"Portal",

Lr_enc_system_locale,

Lr_enc_utf8,

"Param");

With this code, the "portal" is changed from the current system encoding to the UTF-8 format, which can be followed by the following code to complete the conversion of the entire character encoding and continue to access the operation.

Lr_output_message (lr_eval_string ("param"));

Lr_save_string (lr_eval_string ("{param}"), "Param");

Web_url ("Phpwind", "url=http://localhost:8000/phpwind85/", last);

Web_link ("Portal", "Text={param}", last);

LR solves Chinese garbled characters (source--Baidu)

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.