Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
DecodeUTF8 problems
Posted by: JujuLand
Date: August 20, 2007 03:35PM

@ Mark307

here is the code I use:

id(ID_EDIT_SELECT_ALL);
id(ID_EDIT_COPY);
$__data=getclipboard();
alert($__data); << just to verify, it's ok
$ANSI="Empty";
alert($ANSI); << just to verify, it's ok display 'Empty'
$ANSI=pluginmsgex(utils,"DecodeUTF8",$__data,STRING);
alert($ANSI); << $ANSI = "", here is the problem

Have I done something wrong, does the function is bugged, or just the syntax ?

Thanks for debugging me

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: mark307
Date: August 22, 2007 02:38PM

I made sure your code showed empty string when the string in the clipbpard was not ASCII. I guessed the DecodeUTF8 function did not work with non UTF8 string.

The macro plugin treats all strings as UTF8 since 1.0, so a string is converted from UTF8 to ANSI before being passed to other plugin.

I guessed this strange bug was happened in the process. In the macro, a string was converted from UTF8 to ANSI and passed to the utils plugin. The utils plugin tried to convert the string to ANSI, but the string wasn't UTF8, then the plugin returned a empty string.

I see this is difficult problem. Anyway this is outside of mine. :-)
But the DecodeUTF8 might be avoided, because a string is converted to ANSI in many macro statements.

Thanks.

Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: JujuLand
Date: August 22, 2007 06:22PM

Hum, I'm not sure of what you say.

If I don't use DecodeUTF8, and I open the file with an editor, I see it is in UTF8.
if then I convert it with the editor, the format is then ok for the spell Checker.

Do you know a macro statement which decode to Ansi ?
Please give it :-)

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc





Edited 1 time(s). Last edit at 08/22/2007 06:22PM by JujuLand.

Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: kko
Date: August 22, 2007 06:41PM

Alain, take a look at this one. It doesn't need any character set conversion.

Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: JujuLand
Date: August 22, 2007 09:08PM

@ kko,

I'm working on the same spellchecker Aspell, but there is a problem with accents, due to the format.

K-Meleon uses UTF8, Aspell directories use ANSI, and but it's not blocking, Aspell display uses OEM, and if it works, the display is trash.

I know there is no accents in english, and that's why, as the extension was given for en-US, there is no problem.

I have contacted a french guy refered on the french aspell page, but he only maintains the french dictionnary. I'm about to contact the mailist, for the last problem I was talking about.

I have ask also to Dorian for an execwait function in macro. It would be nice, not to need external tools in AutoIt or VisualDialogScript.

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: mark307
Date: August 23, 2007 02:41PM

@JujuLand
I see, exec and setclipboard decode to ANSI on ANSI build, decode to UTF16(UCS2?) on Unicode build, pluginmsg and pluginmsgex statements decode to ANSI on any build. Then the utils plugin always gets ANSI.

BTW. Seamonkey have builtin spellchecker in chrome. Can we use it?

Thanks.

Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: kko
Date: August 23, 2007 04:56PM

Quote
kko
It doesn't need any character set conversion.

Guess, I should have tested with a German text first. :p

You can tell Aspell what encoding to use (see section 4.2.3 in the docs - utf-8 is unfortunately not yet supported).


Quote
mark307
I see, exec and setclipboard decode to ANSI on ANSI build, decode to UTF16(UCS2?) on Unicode build, pluginmsg and pluginmsgex statements decode to ANSI on any build. Then the utils plugin always gets ANSI.

Is ID_EDIT_COPY working different then? I mean, on my German Windows I can copy utf-8 encoded Cyrillc characters from km to my editor without any problem - provided the editor expects utf-8/unicode.


Quote
mark307
Seamonkey have builtin spellchecker in chrome. Can we use it?

Don't know. There are the dictionaries and a dll and an xpt in the components folder. But there must be more. I haven't looked into the chrome yet... (don't know where to start)

Another question is how we get the possible corrections into our menus... (well, we have the jsbridge)

Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: JujuLand
Date: August 23, 2007 08:13PM

Quote

I see, exec and setclipboard decode to ANSI on ANSI build, decode to UTF16(UCS2?) on Unicode build, pluginmsg and pluginmsgex statements decode to ANSI on any build. Then the utils plugin always gets ANSI.
I'll verify it, it could be a possibility

Quote

kko
It doesn't need any character set conversion.

Guess, I should have tested with a German text first. tongue sticking out smiley
Me too, and I have this problem ...

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: mark307
Date: August 24, 2007 02:48PM

Quote
kko
Is ID_EDIT_COPY working different then? I mean, on my German Windows I can copy utf-8 encoded Cyrillc characters from km to my editor without any problem - provided the editor expects utf-8/unicode.

The ID_EDIT_COPY command uses mozilla's nsIClipboardCommands for the contents. I don't have read mozilla's source, but I looked that the command stored texts to the clipboard by some formats what contained Unicode (CF_UNICODETEXT).

Thanks.

Options: ReplyQuote
Re: DecodeUTF8 problems
Posted by: mark307
Date: October 14, 2007 01:37PM

I mocked up a plugin to test mozilla's spellchecker. It works. Details are written at memo and source.

http://mark307.hp.infoseek.co.jp/spelltest-0.0.0.zip (20Kcool smiley

I have to notice, this is for testing, not for using.
Thank you.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.