i have some problems.
i'm writing a extension and therefore i need a path.
when i save a path with an "ö" (e.g. d:\test\töst") over setCharPref,
i can see the correct path in the pref.js.
but when i use getCharPref and put it into an alert, i see
"D:\test\töst"
where is the problem?
thanks in advance
steff
Use getComplexValue with an nsISupportsString instead, that should work.
Axel
> On 11.11.09 15:41, Steff81 wrote:
>
>> when i save a path with an "�" (e.g. d:\test\t�st") over setCharPref,
>> i can see the correct path in the pref.js.
>> but when i use getCharPref and put it into an alert, i see
>>
>> "D:\test\töst"
>
> Use getComplexValue with an nsISupportsString instead, that should work.
And setComplexValue too of course; setCharPref isn't guaranteed to use a
specific charset.
On second thoughts, you should be using it with an nsILocalFile type anyway.
--
Warning: May contain traces of nuts.
thanks for your reply.
i do not use set and get (only when i need the values)
but in the preferences i'm using in the XUL....
<preferences>
<preference id="ae.prefid.normal.directory"
name="ae.prefid.normal.directory" type="unichar"/>
but with complexvalues i cannot use this way.
i cannot find a type for complexvalues on this site:
https://developer.mozilla.org/en/XUL/preference
regards
steff
On 11 Nov., 16:46, Neil <n...@parkwaycc.co.uk> wrote:
> Axel Hecht wrote:
> > On 11.11.09 15:41, Steff81 wrote:
>
> >> when i save a path with an "ö" (e.g. d:\test\töst") over setCharPref,
> >> i can see the correct path in the pref.js.
> >> but when i use getCharPref and put it into an alert, i see
>
> >> "D:\test\töst"
now i'm using "unichar" as type.
but when i use
var dirForExport = autoExportPrefs.getComplexValue(mode +
".directory", nsISupportsString);
the error-console shows
nsISupportsString is not defined
:-(
>nsISupportsString is not defined
>
>
Sorry, we tend to assume around here that you know what
Components.interfaces is.
sorry.... it works
fine ...
thanks :-)