牧羊岛

懒是不会有好果子吃滴//

导航

flash 读取系统默认编码

Posted on 2013-08-27 16:13  牧羊岛  阅读(260)  评论(0编辑  收藏  举报

java有类可以直接读取,但貌似flash没有。

Charset.defaultCharset();

但是浏览器里可以有。

document.defaultCharset;//从当前的区域语言中获取默认字符集。The property is read-only. The property has no default value.
document.charset;//设置或获取用于解码对象的字符集。a, link, script 标签同样有这个属性。The property is read/write. The property has no default value.
document.characterSet;//Returns the character encoding of the current document.
document.inputEncoding;//Returns a string representing the encoding under which the document was parsed (e.g. ISO-8859-1).Warning: Don't use this method! This method has been removed from the draft DOM 4 specification; existing implementations will likely be removed in the near future.

 

这样浏览器里的flash如果可以执行js,就可以读取到系统默认编码。