nsICharsetResolver 编辑

intl/chardet/public/nsICharsetResolver.idlScriptable Please add a summary to this article. Inherits from: nsISupports Last changed in Gecko 1.7

Method overview

void notifyResolvedCharset(in ACString charset, in nsISupports closure);
ACString requestCharset(in nsIWebNavigation aWebNavigation, in nsIChannel aChannel, out boolean aWantCharset, out nsISupports aClosure);

Methods

notifyResolvedCharset()

Some implementations may request that they be notified when the charset is actually detected.

void notifyResolvedCharset(
  in ACString charset,
  in nsISupports closure
);
Parameters
charset
The detected charset.
closure
The closure returned by requestCharset().

requestCharset()

Called to resolve the charset that should be used for parsing the document being loaded from aChannel.

If the charset cannot be resolved, but the implementation of nsICharsetResolver wants to be notified of the final resolved charset when one is available, it can set aWantCharset to true. If this is done, the caller of requestCharset is responsible for calling notifyResolvedCharset() and passing it the final resolved charset and the closure that requestCharset set.

ACString requestCharset(
  in nsIWebNavigation aWebNavigation,
  in nsIChannel aChannel,
  out boolean aWantCharset,
  out nsISupports aClosure
);
Parameters
aWebNavigation
The nsIWebNavigation the document is being loaded in. May be null.
aChannel
The channel the document is coming in from.
aWantCharset
Gets set to true if notifyResolvedCharset() should be called with the given aClosure object.
aClosure
A resulting object which should be passed to notifyResolvedCharset() if aWantCharset is set to true.
Return value

The resolved charset, or an empty string if no charset could be determined.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:90 次

字数:3780

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文