zoukankan      html  css  js  c++  java
  • radphp中日期控件的中文uft8显示

    radphp中的日期控件封装使用的是开源小部件。但默认的的是en方式。

    看源代码中行的处理:

    class DateTimePicker extends FocusControl
    {
            public $_calendar=null;
    
            function __construct($aowner=null)
            {
                    //Calls inherited constructor
                    parent::__construct($aowner);
    
                    date_default_timezone_set($this->TimeZone);
    
                    use_unit('jscalendar/calendar.php');
    
                    $this->_text="";//If format property changes, this is bad: strftime($this->_ifFormat, strtotime('now'));
                   // $this->_calendar = new DHTML_Calendar(RPCL_HTTP_PATH."/jscalendar/", "en", 'calendar-win2k-2', false);
     $this->_calendar = new DHTML_Calendar(RPCL_HTTP_PATH."/jscalendar/", "en", 'calendar-win2k-2', false);
                    $this->Width=200;
                    $this->Height=17;
            }
    。。。
    }
    

      在创建时就选择了语言en。

     在目录x:\Program Files (x86)\Embarcadero\RadPHP\4.0\rpcl\jscalendar\lang是相关的各种语言js代码。其中

     calendar-zh.js是中文,但是gbk码。

    因此解决的方法:权衡利弊,你知道怎么办了。

     
    那么如何用utf8码显示汉字了。可能最简单简单方法:

    x:\Program Files (x86)\Embarcadero\RadPHP\4.0\rpcl\jscalendar\lang下的calendar-zh.js拷贝出来,用文本编辑器保存成utf8后,改名calendar-en.js。

    goodluck!

  • 相关阅读:
    组合数取模的题……
    对组合数取模
    n!(n的阶乘)
    八、元素绑定
    七、Application类
    RC振荡电路
    运算放大器工作原理
    No
    合并查询结果
    连接查询
  • 原文地址:https://www.cnblogs.com/usegear/p/2378415.html
Copyright © 2011-2022 走看看