aspose file tools*
The moose likes JDBC and the fly likes Character encoding to insert TimesPhoneticIPA text into mysql database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Character encoding to insert TimesPhoneticIPA text into mysql database" Watch "Character encoding to insert TimesPhoneticIPA text into mysql database" New topic
Author

Character encoding to insert TimesPhoneticIPA text into mysql database

Ivan Bisevac
Ranch Hand

Joined: Jan 04, 2010
Posts: 48

I have to make java program for dictionary and i got words in .rtf format and i copied these words into .doc because it is easier to read them. I inserted serbian-english words but have problem to insert english-serbian words. Here is the code:




I used mysql database and collation is utf_general_ci and characteSet is utf_general_ci. Serbian-English words are inserted correctly but English-Serbian words are not inserted correctly. Problems are characters that stands for pronounce. For that characters i installed two fonts: TimesPhoneticIPA and TimesPhoneticAlternate. Do i have to change database characterSet or connection string "jdbc:mysql://localhost/recnik?useUnicode=true&characterEncoding=utf-8","root","strxUnKa" or both.

Here is image how it looks in .doc file:



And here is what i get into database:




So, problems are characters between brackets [].

Can someone could help me?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

Ivan Bisevac wrote:And here is what i get into database:


And when you say "get", what exactly does that mean? You are showing us the GUI displayed by some application, aren't you? So the problem might be with that application rather than with the database or your program which puts data into the database.

Ivan Bisevac
Ranch Hand

Joined: Jan 04, 2010
Posts: 48

First image is file multi.doc opened by Microsoft Office Word 2007. Second is mysql database viewer phpmyAdmin.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

You don't have any control over the font used by phpMyAdmin, do you? Perhaps it isn't using a font which can render those IPA characters.

If you have access to such a font, I would recommend writing your own GUI program to extract and (using that font) display information from the database. That would be a more controlled test.
Ivan Bisevac
Ranch Hand

Joined: Jan 04, 2010
Posts: 48

Paul Clapham wrote:You don't have any control over the font used by phpMyAdmin, do you? Perhaps it isn't using a font which can render those IPA characters.

If you have access to such a font, I would recommend writing your own GUI program to extract and (using that font) display information from the database. That would be a more controlled test.


Yes, i don't have any control. But i am not so experienced user to write code for that what you said, to view database. I tried to view database data with tool Sqldeveloper and get same result.

I still think that it is problem with database character set.

Let you first help me to write this extracted words (from doc file) on console. To see if problem is with database or extraction text from word.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Character encoding to insert TimesPhoneticIPA text into mysql database