How can I use multibyte character in zimlet?

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

How can I use multibyte character in zimlet?

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

How can I use multibyte character in zimlet?

Post by 14319KevinH »

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?

Post by Kenji »

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?

Post by 14319KevinH »

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?

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

How can I use multibyte character in zimlet?

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

How can I use multibyte character in zimlet?

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

How can I use multibyte character in zimlet?

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