public static function urlencodeBIG5(str:String):String {
var result:String = "";
var byte:ByteArray = new ByteArray();
byte.writeMultiByte(str, "big5");
for (var i:int; i < byte.length; i++) {
result += escape(String.fromCharCode(byte[i]));
}
return result;
}
//轉換成UTF-8
public static function urlencodeUTF8(str:String):String {
var result:String = "";
var byte:ByteArray = new ByteArray();
byte.writeMultiByte(str, "utf-8");
for (var i:int; i < byte.length; i++) {
result += escape(String.fromCharCode(byte[i]));
}
return result;
}
請參閱「支援的字元集」
沒有留言:
張貼留言