[Project_owners] nsIScriptableUnicodeConverter throws NS_ERROR_UCONV_NOCONV (0x80500001)

Peter B. Shalimoff vshalim at home.ru
Fri Feb 10 12:20:41 EST 2006


Hi all.

I've received a bug report recently:
<quote src="http://pagebookmarks.mozdev.org/notes.html#c21">
Error: uncaught exception: [Exception... "Component returned failure
code: 0x80500001 [nsIScriptableUnicodeConverter.charset]" nsresult:
"0x80500001 ()" location: "JS frame ::
chrome://pagebookmarks/content/pgbm-xml_helpers.js :: loadXMLDocument ::
line 80" data: no]
</quote>

Source code is available at
http://www.mozdev.org/source/browse/pagebookmarks/src/content/pagebookmarks/pgbm-xml_helpers.js?rev=1.5&content-type=text/x-cvsweb-markup

I have a clean install of localized Russian Win98 SE. I installed
Firefox 1.5.0.1 (Gecko/20060111), then installed my extension and tried
to reproduce that bug, but everything works fine.

There are two places in code where converter's 'charset' property is set.
One is in pgbm-XMLBookmark.js, just after creating a converter instance,
and the other is in pgbm-xml_helpers.js when loading XML document. There
is no exception thrown in the first place, but there is in the second one.
In brief:

=== pgbm-ovr.xul ===
<script ... src="pgbm-XMLBookmark.js"></script>
<script ... src="pgbm-xml_helpers.js"></script>


=== pgbm-XMLBookmark.js ===
const uc = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
  .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);

// class Bookmark;
function Bookmark() { ... }
Bookmark.XML_DOCUMENT_CHARSET = "UTF-8";

// No exception at this point.
uc.charset = Bookmark.XML_DOCUMENT_CHARSET;


=== pgbm-xml_helpers.js ===
function loadXMLDocument() {
  ...
  // This is where exception is thrown.
  uc.charset = Bookmark.XML_DOCUMENT_CHARSET;
}

Any ideas what's wrong and how to fix that?

-- 
0xdeadbeef



More information about the Project_owners mailing list