Mysql Table Charset
Archived from the Xataface Users forum.
baetmaen — Thu Oct 06, 2011 5:16 am
Hi,
I’m trying to setup a Frontend for a single Table in a MySQL Database. The Database itself is latin1_swedish_ci , but the table I need to create the frontend for is in ‘utf8_unicode_ci’.
I found the wiki page (http://xataface.com/documentation/how-to/unicode) and played around with both settings.
When I change the output encoding (using: default_oe=UTF-8), the html header (meta Content-Type) changes from ISO-8859-1 to UTF-8.
When I add german language to the ui this would also change the header to UTF-8.
When I change the input encoding (using: default_ie=UTF-8) it seems that nothing happens.
Am I right with the assumption that default_ie will be applied to the MySQL Connection and default_oe is applied to the html header.
Sorry I searched a lot and also played around with the settings since hours but I can’t figure it out.
Am I missing something ?
Best Regards
Jörg
Table Code:
- Code: Select all
CREATE TABLE `erfahrung` ( `id` int(11) NOT NULL, `autor` varchar(160) collate utf8_unicode_ci NOT NULL, `text` text collate utf8_unicode_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
conf.ini
- Code: Select all
- `;;Configuration settings for application
title=”Erfahrungsberichte”
;default_language=”DE”
;default_oe=UTF-8
default_ie=UTF-8
;debug=1
;multilingual=1[_database]
host=”localhost”
name=”database”
user=”user”
password=”password”[_tables]
erfahrung = “Erfahrungen”[languages]
de=”Deutsch”
;en=”English”`
shannah — Thu Oct 06, 2011 10:12 am
default_ie (input encoding) is the encoding that we accept information from forms - and writing to the database. I can’t think of a case where you would want default_ie to be different than default_oe, but they are set as a separate parameter as a design decision.
shannah — Thu Oct 06, 2011 10:13 am
You don’t have to worry so much about the encoding of the underlying tables. MySQL will convert input and output on the fly according to the default_oe and default_ie settings of Xataface. In general, as soon as you step into the multilingual world, it’s better to use UTF-8.