Saving Telugu text to Oracle DB with Java - java

I'm looking for help in saving data in Telugu to an Oracle DB with Java.
I need to generate a message to consumer in this language and save it in the DB and then send the message via SMS. The SMS triggering in done for English but for I need to add it for Telugu.
Sample text is as follows:
విద్యుత్ బకాయిలు కట్టినందుకు ధన్యవాదములు

One solution can be converting the telugu or any unicode text into hexadecimal format with UCS2 tag 81. Then save the complete data as normal english string because hexadecimal contains 0-9 and A-F characters.
Hope this will help. :-)

Related

How can I show arabic query search from MYSQL by JavaFX?

SELECT * FROM `employee` WHERE `name` LIKE "%شريف%"
Above query works fine and find the element by phpmyAdmin query but using it inside JavaFX doesn't get it.
And get the english searchs, So what I need to add in java to permit me search by Arabic.
As per my above comments, I guess it to be a encoding - decoding issue of Java and has nothing specific to do with JavaFX and I also assume that you are not getting any exceptions. You have to use a proper standard while inserting as well as retrieving data. Helpful information is there at , How to store arabic text in mysql database using python?
Refer this article to work only on bytes so your application is always properly internationalized , Byte Encodings and Strings
Refer this one too as how to set encoding in Java , How can I insert arabic word to mysql database using java
Your console might be UTF8 enabled so you are able to match strings there and see Arabic characters.
Hope it helps.

Java display invalid characters?

I have written a program the performs the standard AES S-Box encryption. my problem is that when I encrypt the message it is supposed to write the text to a JTextArea, but it just shows a bunch of little square boxes and when I try to save it to a text document it just makes a bunch of question marks in the text file. how can I make it display the encrypted text? or can I even have it automatically write it to a text document without it creating a bunch of question marks?
I think that I have to use utf-8 text encoding but I have no idea how to do that.
Your text is encrypted as binary data. While encrypted it is not in any character set and cannot be rendered as text. If you want a way to view it, you could Base64 encode the encrypted data.
See: http://en.wikipedia.org/wiki/Base64
The output of the algorithm will not be a valid text in the general case.
If you need to manipulate it as text you can encrypt it in base-64 which uses only valid ASCII characters.

Convert image to textual form(compressed) and back from text to image in android

hello there i want to convert an image to compressed textual form and then i want to send it to the other android user in form of sms and then that textual form need to be converted to the Image, i tried with the base64 encoding but its of no use, because its output is very long.. so that it ll be tough to send that much of text in form of sms, so is there any other way to covert an image to text else any method to compress the text...? please help me and i am work on android emulator and really need your help. Thanks in advance
Regards Hitesh,
Base64 must be OK, because it converts 3 bytes of data to 4 characters of text. You can't decrease size of your data using textual representation. But you can try to compress data and then convert it to text. Maybe it will help.
Base64 encodes the data in base 64, i.e., using 64 different characters. According to the Wikipedia page on SMS an SMS can contain any 7-bit character (that is, you have 128 characters at your disposal!)
Here's the best way to do it:
Compress the image using a compression method of your preference. (jpg for instance)
Find out the sequence of bits that the jpg-data has.
Write this bits as 7-bit characters. (Take special care of padding the last 7 bits.)
Write this sequence of characters as an SMS.

Russian text is not coming in SMS

I try to send a Russian text from my web application, but when the text is sent to a mobile, it is displayed as "?????????". I have tried UTF-8 and all other possible values of charset for Russian text.
Does anyone have a solution for this?
SMS text is by default a special 7bit character set, alternatively Unicode UCS2 can be used. Either way, you will need to either encode your text properly before sending or use a gateway that does the encoding for you.
you can transliterate it, i.e. "Привет" => "Privet"
also check the encoding you use. UTF8 is the most common for international characters these days.
There are several ways to send SMS, one is with Unicode text another is ASCII. Unicode has a larger space requirement so messages max length will be smaller.
Make sure you are sending the text in Unicode format. The SMS gatway API should have documentation on this.

Accessing Unicode telugu text from Ms-Access Database in Java

I have an MS-Access database ( A English-telugu Dictionary database) which contains a table storing English words and telugu meanings.
I am writing a dictionary program in Java which queries the database for a keyword entered by the user and display the telugu meaning.
My Program is working fine till I get the data from the database, but when I displayed it on some component like JTextArea/JEditorPane/ etc... the telugu text is being displayed as '????'. Why is it happening?.
I have seen the solution for "1467412/reading-unicode-data-from-an-access-database-using-jdbc" which provides some workaround for Hebrew language. But it is not working for telugu. i.e I included setCharset("UTF8")before querying from the database. but still I am getting all '?'s.
As soon as I got data from Resultset I am checking the individual characters, all the telugu characters are being encoded by 63 only. This is my observation. I guess this must be some type of encoding problem. I would be very glad if somebody provides some solution for this. Thanks in advance.
After you get the text from the database, before you display in Java Swing widgets, are you setting the font? Set the font to "Gautami" and see whether it solves the problem;

Categories