Page 1 of 1

How can I use multibyte character in zimlet?

Posted: Wed Jun 14, 2006 7:42 pm
by Kenji
I can use multibyte character(Kanji) in Zimbra

but I cannot use in zimlet.
How can I use multibyte character in zimlet?
Thanks&Regards

How can I use multibyte character in zimlet?

Posted: Fri Jun 16, 2006 11:20 pm
by 14319KevinH
Which Zimlet? Or are you trying to write your own?

How can I use multibyte character in zimlet?

Posted: Sun Jun 18, 2006 8:00 pm
by Kenji
I'm trying to write by myself.

How can I use multibyte character in zimlet?

Posted: Mon Jun 19, 2006 5:41 pm
by 14319KevinH
What error are you getting? Can you post the code that has the error?

How can I use multibyte character in zimlet?

Posted: Mon Jun 19, 2006 7:39 pm
by Kenji
This is my source based on com_zimbra_sforce.
/// Called by the Zimbra framework when the SForce panel item was clicked

Com_Zimbra_Osc.prototype.singleClicked = function() {

alert('singleClicked start');
//I want to display "display japanese:テスト"

alert('display japanese:テスト');
if(!this.sessionID) {

alert('login');

this.login();

}

else {

alert('get Meeting');

this.get_meeting();

}
alert('singleClicked end');

}
broken_character.JPG

How can I use multibyte character in zimlet?

Posted: Tue Jun 20, 2006 9:20 am
by 14319KevinH
Ahh ok you need to use the Unicode representation and not the literal strings. There's no Zimbra specific code there, by just calling alert() on some text is native JavaScript. You need to use the same encoded characters just like you put in the properties files for localization.

How can I use multibyte character in zimlet?

Posted: Wed Jun 21, 2006 9:44 am
by Kenji
I see.
I want to encode string to Unicode without using native2ascii.
I prepared two files.

They are being encoded to Unicode(UTF-8,UTF-16)
If string is encoded to UTF-8, then broken string is displayed.

But if string is encoded to UTF-16, then normal string is displayed.
I want to convert UTF-8 to UTF-16 in zimlet module.

Do you know such a function?
I'm sorry by my poor English.
Thanks&Regards

How can I use multibyte character in zimlet?

Posted: Wed Jun 21, 2006 12:13 pm
by 14319KevinH
I don't know of any UTF-16 converters in JavaScript. It might be better to do that in a JSP or on the server side.