Base, MySQL and UTF-8

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
kmieciu
Posts: 1
Joined: Thu Dec 13, 2007 5:47 pm

Base, MySQL and UTF-8

Post by kmieciu »

I have a web app in php with MySQL database, both using UTF-8 encoding. I created Base forms to edit that database, but Base is reading and writing data using ISO-8859-2 encoding. I'm using MySQL JDBC driver (the one from Connector/J) which have encoding set to UTF-8 and generic JDBC driver with datasource set to: jdbc:mysql://host/db?characterEncoding=utf8 - the same result with both, ISO encoding instead of UTF. How to make Base use UTF-8 ?
User avatar
DrewJensen
Volunteer
Posts: 1734
Joined: Sat Oct 06, 2007 9:01 pm
Location: Cumberland, MD - USA

Re: Base, MySQL and UTF-8

Post by DrewJensen »

Well, I can tell you only that this does seem to work properly for me with the following environment:

XP SP2 & Kubuntu 7.1
MySQL 5.0.11
MySQL JDBC 5.1.0
JRE 1.6.03 (Under XP ) - forget exactly where I am under Kubuntu but it is SUN JRE I use.

That said it does not mean that I have not run into problems - only that every time I have it turns out to be something like this.

I created the database and did not set the default to UTF8, then created a table and did set the default ( For the table ) to UTF8. Base now has a problem - even if you tell the JDBC driver to use UTF8 it still seems to auto detect the character setting - based on the overall database setting and not the per-table setting. Well, let me put it another way - twice I ran into the type of problem you describe and both times it seemed to be because of this scenario. Also, when I have had problems it has always been that the data would not post at all - an error would be raised. I have not the situation where it just corrupted characters.

In the cases where I created the database, default character encoding UTF8 and then did the same for the tables - then I have not had a problem.

Not sure that helps at all - just my experience so far.
Former member of The Document Foundation
Former member of Apache OpenOffice PMC
LibreOffice on Ubuntu 18.04
wurzel
Volunteer
Posts: 145
Joined: Sun Dec 09, 2007 10:39 am

Re: Base, MySQL and UTF-8

Post by wurzel »

Hi,

http://qa.openoffice.org/issues/show_bug.cgi?id=78486


Apparently, you need to force unicode use by adding the correct parameter to your jdbc driver connection parameters.

testdb?useUnicode=true&characterEncoding=UTF-8

Alex

PS: The issue also points here :
http://www.olat.org/docu/install/Databa ... ation.html

which contains another driver parameter setting as well that you might like to try.
bk8133
Posts: 1
Joined: Thu Feb 07, 2008 1:22 am

Re: Base, MySQL and UTF-8

Post by bk8133 »

Thanks !!!! :D .. the hint about enforcing utf8 on connection string helped a lot

I actually supposed that, but i couldn't figure it out where to put it.. :| .. NoW i knOw :lol:
Post Reply