内容摘要:在 Delphi 2007 for PHP 中,中文显示(尤其是按钮中的文显示)可以用如下的方法进行解决:
在 Delphi 2007 for PHP 中,中文显示(尤其是按钮中的文显示)可以用如下的方法进行解决:
使用页面对象的setEncoding($value)方法来为页面指定charset,$value的格式为"编码说明|编码",如下所示为将页面设置为GBK编码:
$Unit1->setEncoding("Chinese China (zh-cn)|GBK");
setEncoding应该放置在loadResource(__FILE__)之后,show()之前.
<?php
//Includes
require_once("vcl/vcl.inc.php");
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
//Classdefinition
classMainextendsPage
{
public$Button1=null;
}
global$application;
global$Main;
//Createstheform
$Main=newMain($application);
//Readfromresourcefile
$Main->loadResource(__FILE__);
$Main->setEncoding("ChineseChina(zh-cn)|GBK");
//Showstheform
$Main->show();
?>
责编:豆豆技术应用
正在加载评论...
- Delphi新闻
- Delphi教程
- Delphi 7.0
- Delphi 2007
- Delphi控件
- Delphi网络编程
- Delphi for php
- Delphi界面/视图
- Delphi系统控制
- Delphi数据库
- Delphi源码下载