Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > Garbled String Problem

Reply
Thread Tools

Garbled String Problem

 
 
vknight vknight is offline
Junior Member
Join Date: Sep 2010
Posts: 2
 
      09-28-2010
Hello,

I have an application that uses TMF814 IDL and JacORB.
The application works fine until I tested to input using japanese characters.
The japanese characters seems to be garbled when it reaches the client.

Sample:
Client ---> server.getMessage();
Server
------
string getMessage()
{
return こんにちわ;
}
-----
Client Output: r?Lj

I searched the web for similar problems, their suggestion was to change the idl implementation from string to wstring. They said that its because java string is 2 bytes and idl string is 1 byte.
I tried to create a simple application to test their suggestion but the problem is I cannot change the idl because its a standard idl from TMF814. So i need a workaround so that the string can be viewed in the client with its current format preserved.

Can anyone help me on this?

There was also a similar post i found and the solution was to use ISO-8859-1 encoding and to convert the string from C++ string to idl string using UJTOSJ/
SJTOUJ. What is the equivalent function of UJTOSJ in Java?

Btw, my application is in Java and is using UTF-8 encoding.

Thanks,
Vergil
 
Reply With Quote
 
 
 
 
wwonka wwonka is offline
Junior Member
Join Date: Sep 2010
Posts: 4
 
      09-30-2010
I have no idea what TMF814 IDL and JacORB technologies are, but suffice it to say you need UTF-8 (2-bytes per character) all the way from your Java code through to the client so the text doesn't get garbled. If you convert to 1-byte per character strings then you're screwed because 1 byte is generally only for ASCII characters.

ASCII only goes up to 255 which means you can only display 255 characters. Look up ASCII charts online to see which 255 these are. You're going to have problems with copyright symbols and registered trademarks and many other languages besides japanese unless you can use the proper string encoding all the way through your application.

Hope this is of some help.
 
Reply With Quote
 
 
 
 
vknight vknight is offline
Junior Member
Join Date: Sep 2010
Posts: 2
 
      10-05-2010
Thank for the reply.

Yes I see that the problem is what encoding to use or what string manipulation is needed so that the data would not be garbled. Do you know any technique?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_python.so is garbled mod_python.so is garbled blbmdsmith Python 1 12-14-2006 12:15 AM
Garbled Display after SP2 Installed - Please help!! =?Utf-8?B?VGhlYQ==?= Microsoft Certification 3 05-02-2005 04:07 PM
cookie value being garbled. Peter Row ASP .Net 0 05-24-2004 08:38 AM
garbled JFrame patrick Java 0 12-05-2003 08:32 AM
Garbled appearance of .NET app on Presario 700 Steve Covert ASP .Net 2 11-11-2003 10:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57