Accessing Unicode telugu text from Ms-Access Database in Java - 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;

Related

Saving Telugu text to Oracle DB with 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. :-)

How to store and retrieve text data in a formatted way?

I am building my website using Java and the SQL Server database. It is just like Stack Overflow where I have to store questions, answers, comments and images.
I am not able to store the text in a formatted way in SQL Server's text data type. Neither I am able to display it in a formatted way like Stack Overflow does. All solutions I've found so far concerns only PHP and MySQL. No help for Java and SQL Server. When I retrieve the text to display on web page it's all a mess. All I want to display the question and answers on my website just like Stack Overflow does. I'm attaching an image of my display page here to explain my problem. It is the image of a text ousput display from my website.
Image of output display from my website
First off: from MSDN, the "text", "ntext" and "image" data types will be soon removed from SQL Server, so you should avoid using them.
For text, use varchar(max); for ntext, use nvarchar(max) and for image, use varbinary (max).
I know from developing SSIS packages that SQL Server processes text types as a stream of non-unicode characters. So what I advise you to try is:
Change your datatype to nvarchar(max), to support unicode characters, what might be your problem;
Try to convert your nvarchar(max) to a string type before displaying. You can cast the data using SQL Server, even in a stored procedure.

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.

Properly storing copy/pasted text from a Microsoft Office document into a MySQL database

I know that Microsoft office uses different encoding, what happen is when someone copy and paste texts from office to java text panel, it looks OK. But you then store it into MySQL database, and retrieve it. It suddenly become all kind of rubbish Latin characters.
I've tried to convert it to utf-8 before store, but seems not work.
Wonder if there is anyway you can detect whether there is any latin characters in your text, so I can simply popup an alert to let user know before they save it.
Or, if there is anyway to disable the jTextField to only display everything in UTF-8 characters, so that when user copy and paste from word, it auto shows all the random codes instead of looking fine (at the beginning)
Example: With user entered something in word, and paste to jTextField, we pass the string directly(Note our sql database is utf8_general_ci), we then just fetch it to the JPanel, and we get:
ÃÃâ€
’¢â‚¬ââââ‚
I've had similar issues. First thing to do is find out what exactly has been written to the database. This is very easy with MySQL, just logon and run
SELECT HEX( column ) FROM table;
That'll give you the bytes that have been written to the table. You can then use an app I wrote for this very purpose. Take the hex string you got back from MySQL and give it to the main class using the -b flag for bytes. You'll get a whole heap of output, and hopefully one of them will be what you had originally.
Once you know what it's being stored as, you have a starting point for debugging.

How to receive Unicode String from database by Java

I'm Vietnamese, I used to use some Unicode character ex 'Việt Nam', â, ẵ, ấ, ị, đ, Đ, Ệ, Ố, ư..., I'm having a exercise relate with insert/receive data from database, I'm using Java. I can not receive data from database without many error with there character. Who can help me ?
It whould be better to understand your problem with the exact error code. But as I underestand you, your problem is that you have something in database ( and it's okthere ) but when you want to read and show it, you face with some problems. With these background I think:
you have to use utf-8 to store and read data.
your application have to support your locale. ( for instance as I know JDK doesn't support fa_IR locale, so it may be your problem)
But as there are lots of vietnamians java application, your problem should belongs to your DAL.
Provide complete error and ensure that your data is stored correctly in your database.
Try Java 7 if you want to use Access database.
Otherwise, use a different DBMS that Java currently supports queries or updates with Unicode characters.
Java Programming with Vietnamese

Categories