[Greasemonkey] Login script,
problem with international chars and privacy concerns
Johan Sundström
oyasumi at gmail.com
Sat Aug 19 00:42:25 EDT 2006
On 8/18/06, Lenny Domnitser <ldrhcp at gmail.com> wrote:
> On 8/18/06, Jonas Lundberg <my.name.is.hans at gmail.com> wrote:
> > Firefox (or is it greasemonkey? I am not sure) unfortunately only has
> > partial support for international characters (unless there has been
> > very recent changes).
>
> Firefox has great support for Unicode, but unfortunately, it is
> impossible to specify the encoding of a Greasemonkey script, and I'm
> not sure what the default encoding is. Since Javascript strings are
> Unicode, the character can be entered in the \u escaping format:
> '\u00F6' produces 'ö'.
The default encoding is UTF8, in which "ö" is "ö". Another method
than storing password constants verbatim in the script is to have
script configuration variables, like in this script:
http://userscripts.org/scripts/show/5102
It's just as bad security wise, but it makes it easier to put anything
in for the password without thinking about encodings. A handy method
for encoding and decoding UTF8 if you don't have any other tool (or
need to do it in javascript) is available here:
http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html
--
/ Johan Sundström, http://ecmanaut.blogspot.com/
More information about the Greasemonkey
mailing list