Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getcharPref and german umlaut

12 views
Skip to first unread message

Steff81

unread,
Nov 11, 2009, 9:41:04 AM11/11/09
to
Hi,

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

Axel Hecht

unread,
Nov 11, 2009, 10:04:40 AM11/11/09
to
On 11.11.09 15:41, Steff81 wrote:
> Hi,
>
> 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

Neil

unread,
Nov 11, 2009, 10:46:06 AM11/11/09
to
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"
>

> 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.

Steff81

unread,
Nov 11, 2009, 1:54:59 PM11/11/09
to
Hi,

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"

Steff81

unread,
Nov 11, 2009, 2:52:54 PM11/11/09
to

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
:-(

Neil

unread,
Nov 11, 2009, 4:11:25 PM11/11/09
to
Steff81 wrote:

>nsISupportsString is not defined
>
>
Sorry, we tend to assume around here that you know what
Components.interfaces is.

Steff81

unread,
Nov 12, 2009, 2:19:35 AM11/12/09
to

sorry.... it works
fine ...

thanks :-)

0 new messages