Commit 49067e2f authored by Medicean's avatar Medicean

(Change:Database) 强制php sqlsrv使用utf-8编码

该驱动只存在两种类型字符集连接方式(utf-8, char)
parent f85064b5
......@@ -77,8 +77,7 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]);
$chs=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
$chs=$chs?$chs:'utf-8';
$chs='utf-8';
$T=@sqlsrv_connect($hst,array("UID"=> $usr,"PWD"=>$pwd,"Database"=>$dbn,"CharacterSet"=>$chs));
$q=@sqlsrv_query($T,$sql,null);
if($q!==false){
......@@ -111,6 +110,6 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
[arg3]: '#{passwd}',
[arg4]: '#{db}',
[arg5]: '#{base64::sql}',
[arg6]: '#{encode}'
// [arg6]: '#{encode}'
}
})
......@@ -409,6 +409,13 @@ class PHP {
passwd: ''
});
break;
case 'sqlsrv':
form.setFormData({
host: 'localhost',
user: 'sa',
passwd: ''
});
break;
default:
form.setFormData({
user: 'dbuser',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment