Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Invoke Share With Asian Character

I have invoke share currently set up and working with the following format.

 

function share(share) {

var request = {
action: 'bb.action.SHARE',
mime : 'text/plain',
data : share,
target_type: ["APPLICATION", "VIEWER", "CARD"]
};

blackberry.invoke.card.invokeTargetPicker(request, "Share Wallpapers",

// success callback
function() {
console.log('success');
},

// error callback
function(e) {
console.log('error: ' + e);
}
);
}

 

I can pass through a message like so...

 

share("message");

 

When I use an asian character like this...

 

share("読"); 

 

It works but when I go like this

 

var shareContent = "読";

share(shareConent);

 

I get back "INVALID_CHARACTER_ERR: DOM Exception 5"

 

Any ideas on what this might be? Encoding issue?

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Invoke Share With Asian Character

Yeah, it feels like an encoding problem.  Very strange behavior by JavaScript, but its a very strange language with strange behaviors Smiley Happy

 

Can you confirm that in the HTML file which is including this JavaScript, that you have set the page encoding correctly?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Highlighted
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Invoke Share With Asian Character

I have the following

<meta charset="UTF-8">

Is there another encoding that I should try?
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis