Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3962622
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:07:05+00:00 2026-05-20T03:07:05+00:00

In my Blackberry application I am loading JSON using the following method. private static

  • 0

In my Blackberry application I am loading JSON using the following method.

 private static Object loadJson(String uriStr){
    Object _json = null;
    Message response = null;
    BlockingSenderDestination bsd = null;

    try
    {
        bsd = (BlockingSenderDestination)
                    DestinationFactory.getSenderDestination
                        ("CommAPISample", URI.create(uriStr));

        if(bsd == null)
        {
            bsd =
              DestinationFactory.createBlockingSenderDestination
                  (new Context("CommAPISample"),
                   URI.create(uriStr), new JSONMessageProcessor()
                   );
        }
        response = bsd.sendReceive();
        _json = response.getObjectPayload();       
    }
    catch(Exception e)
    {
        System.out.println(e.toString());
    }
    finally
    {
        if(bsd != null)
        {
            bsd.release();
        }
    }
    return _json;
}

This is working fine. But the problem is when I am getting JSON, Arabic characters show as junk

(الرئيس التنÙ) . I submitted this issue to Blackberry support form

Arabic shows corrupted in the JSON output

As per the discussion, I encode the Arabic character into \uxxxx format(In my server side application) and it was working. But now I have to use a JSON from somebody else where I can’t change the server side code.

They are using asp.net C# , as per them they are sending the data like the following.

 JsonResult result = new JsonResult();
 result.ContentEncoding = System.Text.Encoding.UTF8;
 result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
 result.Data = “Data Object (Contains Arabic) comes here”
 return result;

So my question is, If the server provide the data in the above manner, BlockingSenderDestination.sendReceive method can get a utf-8 data? Or it is expecting only \uxxxx encoded data for non-ascii. Or I have to do something else (like sending some header to server) so that I can directly use the utf-8 data.

In debug mode I check the value of ‘response’. It is already showing junk characters.

Except from JSON I am able to handle Arabic everywhere else.

Yesterday I posted this issue in Blackberry form . But till now no reply.

I am new to blackberry and Java. So I am sorry if this is silly question.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:07:06+00:00Added an answer on May 20, 2026 at 3:07 am

    At last I found the solution myself.

    The data sending from server was in UTF-8 which uses double byte to show single character. But BlockingSenderDestination.sendReceive() is not able to identify that. So it is creating one character for each byte. So the solution was to get each character and get the byte from that character and add to a byte array. From that byte array create a string with UTF8 encoding.

    If anyone know to use BlockingSenderDestination.sendReceive() for utf-8 please post here. So that we can avoid this extra conversion method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using kXML in my Blackberry application using Java. I want to create a
We're about to build a Blackberry application but would love some input on whether
Is there any api for viewing html content from w/in your blackberry application? To
Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an
The BlackBerry Desktop API has the interface IRimTable which apparently maps an application database
My BlackBerry application consumes axis2 web services. SOAP POST HTTP request constantly fails with
I have a Blackberry Application which I had been testing on my simulator. Now
I am developing a BlackBerry application where the server is in Java. Whenever AES
I'm developing a blackberry application to remotely access an external customer database. Selected employees
I have built a blackberry application that allows a user to fill in information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.