How can I use multibyte character in zimlet?

Interested in talking about Mash-up's? This is the place.
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I use multibyte character in zimlet?

Postby Kenji » Wed Jun 14, 2006 7:42 pm

I can use multibyte character(Kanji) in Zimbra

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


14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I use multibyte character in zimlet?

Postby 14319KevinH » Fri Jun 16, 2006 11:20 pm

Which Zimlet? Or are you trying to write your own?
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I use multibyte character in zimlet?

Postby Kenji » Sun Jun 18, 2006 8:00 pm

I'm trying to write by myself.
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I use multibyte character in zimlet?

Postby 14319KevinH » Mon Jun 19, 2006 5:41 pm

What error are you getting? Can you post the code that has the error?
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I use multibyte character in zimlet?

Postby Kenji » Mon Jun 19, 2006 7:39 pm

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

14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I use multibyte character in zimlet?

Postby 14319KevinH » Tue Jun 20, 2006 9:20 am

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.
Kenji
Posts: 17
Joined: Fri Sep 12, 2014 10:12 pm

How can I use multibyte character in zimlet?

Postby Kenji » Wed Jun 21, 2006 9:44 am

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
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

How can I use multibyte character in zimlet?

Postby 14319KevinH » Wed Jun 21, 2006 12:13 pm

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.

Return to “Zimlets”

Who is online

Users browsing this forum: No registered users and 7 guests