zoukankan      html  css  js  c++  java
  • LR 解决中文乱码(来源——百度)

    因为我们使用的中文操作系统默认的中文编码格式是GB2312,所以LR对服务器的返回内容自动使用GB2312方式阅读的,但是几乎所有的中文网站现在都在使用UTF-8的方式来编码,由于解码编码的方式不同最终导致中文处理的错误。

    对于这种编码问题,我们可以使用函数 lr_convert_string_encoding()函数来处理。

    例如,我们需要将中文“门户”变更为UTF-8格式,那么代码可以这样写:

    lr_convert_string_encoding(

    "门户",

    LR_ENC_SYSTEM_LOCALE,

    LR_ENC_UTF8,

    "param");

    通过这个代码将“门户”由当前的系统编码变更为UTF-8格式后可以接下面的代码完成整个字符编码转化并且继续访问的操作。

    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("门户",“TEXT={param}”,LAST);

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  • 相关阅读:
    属性选择器
    Map
    tomcat 启动失败
    find for /f 分割字符串 bat
    oracle 1day
    scott lock
    oracle oracle sqldeveloper 12505 创建连接失败
    oracle sql developer 启动java.exe设置错误
    servlet post response.sendRedirect 乱码

  • 原文地址:https://www.cnblogs.com/coolfeng/p/4228443.html
Copyright © 2011-2022 走看看