TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv

Die TYPO3 Mailingliste - nicht fragen: lesen!

[TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

This is a discussion on [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1 within the typo3-english@lists.netfielders.de forums, part of the TYPO3-Mailinglists: ENGLISH category; Hi everybody, here's my summer trouble, if somebody can help me ... i can send some free beer ;-) I have ...


Zurück   TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv > TYPO3-Mailinglists: ENGLISH > typo3-english@lists.netfielders.de

Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren
  #1  
Alt 18.08.2008, 00:32
Dominique Feyer
Gast
 
Beiträge: n/a
Standard [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Hi everybody, here's my summer trouble, if somebody can help me ... i
can send some free beer ;-)

I have a TYPO3 installation setup in UTF-8, like that:

$TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv';
$TYPO3_CONF_VARS['SYS']['t3lib_cs_utils'] = 'iconv';
$TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';

Is the TS template

config.renderCharset = utf-8

But i forgot to set in localconf.php the line:

$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';

If I add this line, the frontend (templavoila) loose the template
configuration, and in the backend all the accentuated characters as
trouble.

So my MySQL client is always in latin1 (I check the configuration of
mysql with SHOW VARIABLES, and it's the case)

Everything work nice in the TYPO3 backend and frontend, but if I
insert data in the TYPO3 database with phpmyadmin or an other mysql
client correctly configured in UTF8, the output in TYPO3 is not good

When i browse my database in PHPMyAdmin, i can't see the accentuated
characters correctly except if I edit this record with phpmyadmin.
But in this case TYPO as some trouble with the accentuated characters.

If I understand well the problem, TYPO3 send UTF8 data, but the MySQL
client translate it lik if the data was in latin1 to UTF8 (the
database use utf8_general_ci as collation). finaly my data are not in
UTF8 nor in latin1 ...

So my 2 cents question, is how can I translate/convert this DB to
have a standard UTF-8 configuration.

I have a lots of data inside the database so a manual edition is not
possible

Thanks a lots for your help

Dominique Feyer



_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #2  
Alt 18.08.2008, 08:45
Xavier Perseguers
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Hi Dominique,

Dominique Feyer wrote:
> Hi everybody, here's my summer trouble, if somebody can help me ... i
> can send some free beer ;-)
>
> I have a TYPO3 installation setup in UTF-8, like that:
>
> $TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv';
> $TYPO3_CONF_VARS['SYS']['t3lib_cs_utils'] = 'iconv';
> $TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
>
> Is the TS template
>
> config.renderCharset = utf-8
>
> But i forgot to set in localconf.php the line:
>
> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';
>
> [...]
>
> So my 2 cents question, is how can I translate/convert this DB to have a
> standard UTF-8 configuration.
>
> I have a lots of data inside the database so a manual edition is not
> possible


Give it a try:
http://xavier.perseguers.ch/en/tutor...ion/utf-8.html

--
Xavier Perseguers
http://xavier.perseguers.ch/en
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #3  
Alt 18.08.2008, 12:05
Dmitry Dulepov [typo3]
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Hi!

Dominique Feyer wrote:
> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';
>
> If I add this line, the frontend (templavoila) loose the template
> configuration, and in the backend all the accentuated characters as
> trouble.


Yes. MySQL starts returning data differently. TemplaVoila cannot decode it anymore. You need to remap templates.

> Everything work nice in the TYPO3 backend and frontend, but if I insert
> data in the TYPO3 database with phpmyadmin or an other mysql client
> correctly configured in UTF8, the output in TYPO3 is not good


What do you mean by "correctly configured"?

> When i browse my database in PHPMyAdmin, i can't see the accentuated
> characters correctly except if I edit this record with phpmyadmin. But
> in this case TYPO as some trouble with the accentuated characters.


I guess phpMyAdmin does not make "set names utf8" automatically for you. This is why you see data in the wrong way.

--
Dmitry Dulepov
TYPO3 Core team
My TYPO3 book: http://www.packtpub.com/typo3-extens...velopment/book
In the blog: http://typo3bloke.net/post-details/t...ng_in_eclipse/
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #4  
Alt 18.08.2008, 13:26
Lars Haendler
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Dominique Feyer wrote:
> Hi everybody, here's my summer trouble, if somebody can help me ... i
> can send some free beer ;-)
>
> I have a TYPO3 installation setup in UTF-8, like that:
>
> $TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv';
> $TYPO3_CONF_VARS['SYS']['t3lib_cs_utils'] = 'iconv';
> $TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
>
> Is the TS template
>
> config.renderCharset = utf-8
>
> But i forgot to set in localconf.php the line:
>
> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';


So, you are running a live system all the time and now you changed the
setDBinit?

> If I understand well the problem, TYPO3 send UTF8 data, but the MySQL
> client translate it lik if the data was in latin1 to UTF8 (the database
> use utf8_general_ci as collation). finaly my data are not in UTF8 nor in
> latin1 ...


No, the problem now occurs because you added SET NAMES utf8. Your former
configuration without SET NAMES worked fine in itself. The configuration
was wrong when you liked it to be completly in utf8, but in itself it
worked. - We had the same thing on one server.

> So my 2 cents question, is how can I translate/convert this DB to have a
> standard UTF-8 configuration.


We had a similar problem with all our TYPO3 Installs on a certain
server. Doing a convert on the fly isnt that funny - I would suggest
leaving SET NAMES out and live with this misconfigured system. As I
said: it works.

If you want to convert you have to alter the DB character set first.
Then change collations of the tables (needed for searching). Then
convert all content in all relevant tables. Truncate caching tables. The
last part is go through your TypoScript and check if those are also
converted.

> I have a lots of data inside the database so a manual edition is not
> possible


I could send you a script I made for this purpose, but it only works if
dont already have mixed up the encoding. Meaning if you have content in
your DB that was inserted without SET NAMES utf8 in you localconf and
content that was insertet with SET NAMES utf8 ... you have a problem.

> Thanks a lots for your help
>
> Dominique Feyer


Greetings
Lars
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #5  
Alt 18.08.2008, 14:48
Dominique Feyer
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Le 18 août 08 à 12:05, Dmitry Dulepov [typo3] a écrit :

> Hi!
>
> Dominique Feyer wrote:
>> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';
>>
>> If I add this line, the frontend (templavoila) loose the template
>> configuration, and in the backend all the accentuated characters as
>> trouble.

>
> Yes. MySQL starts returning data differently. TemplaVoila cannot
> decode it anymore. You need to remap templates.
>
>> Everything work nice in the TYPO3 backend and frontend, but if I
>> insert
>> data in the TYPO3 database with phpmyadmin or an other mysql client
>> correctly configured in UTF8, the output in TYPO3 is not good

>
> What do you mean by "correctly configured"?


I mean the client configured as UTF8 (like 'SET NAMES utf8;' for
phpmyadmin, or UTF8 for ODBC)

>
>> When i browse my database in PHPMyAdmin, i can't see the accentuated
>> characters correctly except if I edit this record with phpmyadmin.
>> But
>> in this case TYPO as some trouble with the accentuated characters.

>
> I guess phpMyAdmin does not make "set names utf8" automatically for
> you. This is why you see data in the wrong way.


I see the data correctly in the typo3 backend but not in PHPMyAdmin
(configured as UTF8) and external database tool connected over ODBC
as UTF8

>
> --
> Dmitry Dulepov
> TYPO3 Core team
> My TYPO3 book: http://www.packtpub.com/typo3-extension-development/
> book
> In the blog: http://typo3bloke.net/post-details/
> typo3_code_formatting_in_eclipse/
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english (AT) lists (DOT) netfielders.de
> http://lists.netfielders.de/cgi-bin/.../typo3-english


_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #6  
Alt 18.08.2008, 14:52
Dominique Feyer
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Le 18 août 08 à 13:26, Lars Haendler a écrit :

> Dominique Feyer wrote:
>> Hi everybody, here's my summer trouble, if somebody can help me ... i
>> can send some free beer ;-)
>>
>> I have a TYPO3 installation setup in UTF-8, like that:
>>
>> $TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv';
>> $TYPO3_CONF_VARS['SYS']['t3lib_cs_utils'] = 'iconv';
>> $TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
>>
>> Is the TS template
>>
>> config.renderCharset = utf-8
>>
>> But i forgot to set in localconf.php the line:
>>
>> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';

>
> So, you are running a live system all the time and now you changed the
> setDBinit?


Yes exactly

>
>> If I understand well the problem, TYPO3 send UTF8 data, but the MySQL
>> client translate it lik if the data was in latin1 to UTF8 (the
>> database
>> use utf8_general_ci as collation). finaly my data are not in UTF8
>> nor in
>> latin1 ...

>
> No, the problem now occurs because you added SET NAMES utf8. Your
> former
> configuration without SET NAMES worked fine in itself. The
> configuration
> was wrong when you liked it to be completly in utf8, but in itself it
> worked. - We had the same thing on one server.
>
>> So my 2 cents question, is how can I translate/convert this DB to
>> have a
>> standard UTF-8 configuration.

>
> We had a similar problem with all our TYPO3 Installs on a certain
> server. Doing a convert on the fly isnt that funny - I would suggest
> leaving SET NAMES out and live with this misconfigured system. As I
> said: it works.


Yes it work if i use only TYPO3 to access the database, but some data
are send with Filemaker over ODBC (in UTF8) and in this case TYPO3
can't handle correctly this content (accent problem, and special
caracter)

>
> If you want to convert you have to alter the DB character set first.
> Then change collations of the tables (needed for searching). Then
> convert all content in all relevant tables. Truncate caching
> tables. The
> last part is go through your TypoScript and check if those are also
> converted.
>
>> I have a lots of data inside the database so a manual edition is not
>> possible

>
> I could send you a script I made for this purpose, but it only
> works if
> dont already have mixed up the encoding. Meaning if you have
> content in
> your DB that was inserted without SET NAMES utf8 in you localconf and
> content that was insertet with SET NAMES utf8 ... you have a problem.


I have only data without the SET NAMES utf8 it try to add this
configuration only a on staging environnement

>
>> Thanks a lots for your help
>>
>> Dominique Feyer

>
> Greetings
> Lars
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english (AT) lists (DOT) netfielders.de
> http://lists.netfielders.de/cgi-bin/.../typo3-english


_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #7  
Alt 18.08.2008, 16:11
Lars Haendler
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Dominique Feyer wrote:
>
> Le 18 août 08 à 13:26, Lars Haendler a écrit :
>
>> Dominique Feyer wrote:
>>> Hi everybody, here's my summer trouble, if somebody can help me ... i
>>> can send some free beer ;-)
>>>
>>> I have a TYPO3 installation setup in UTF-8, like that:
>>>
>>> $TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv';
>>> $TYPO3_CONF_VARS['SYS']['t3lib_cs_utils'] = 'iconv';
>>> $TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
>>>
>>> Is the TS template
>>>
>>> config.renderCharset = utf-8
>>>
>>> But i forgot to set in localconf.php the line:
>>>
>>> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';

>>
>> So, you are running a live system all the time and now you changed the
>> setDBinit?

>
> Yes exactly
>
>>
>>> If I understand well the problem, TYPO3 send UTF8 data, but the MySQL
>>> client translate it lik if the data was in latin1 to UTF8 (the database
>>> use utf8_general_ci as collation). finaly my data are not in UTF8 nor in
>>> latin1 ...

>>
>> No, the problem now occurs because you added SET NAMES utf8. Your former
>> configuration without SET NAMES worked fine in itself. The configuration
>> was wrong when you liked it to be completly in utf8, but in itself it
>> worked. - We had the same thing on one server.
>>
>>> So my 2 cents question, is how can I translate/convert this DB to have a
>>> standard UTF-8 configuration.

>>
>> We had a similar problem with all our TYPO3 Installs on a certain
>> server. Doing a convert on the fly isnt that funny - I would suggest
>> leaving SET NAMES out and live with this misconfigured system. As I
>> said: it works.

>
> Yes it work if i use only TYPO3 to access the database, but some data
> are send with Filemaker over ODBC (in UTF8) and in this case TYPO3 can't
> handle correctly this content (accent problem, and special caracter)
>
>>
>> If you want to convert you have to alter the DB character set first.
>> Then change collations of the tables (needed for searching). Then
>> convert all content in all relevant tables. Truncate caching tables. The
>> last part is go through your TypoScript and check if those are also
>> converted.
>>
>>> I have a lots of data inside the database so a manual edition is not
>>> possible

>>
>> I could send you a script I made for this purpose, but it only works if
>> dont already have mixed up the encoding. Meaning if you have content in
>> your DB that was inserted without SET NAMES utf8 in you localconf and
>> content that was insertet with SET NAMES utf8 ... you have a problem.

>
> I have only data without the SET NAMES utf8 it try to add this
> configuration only a on staging environnement
>
>>
>>> Thanks a lots for your help
>>>
>>> Dominique Feyer

>>
>> Greetings
>> Lars
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english (AT) lists (DOT) netfielders.de
>> http://lists.netfielders.de/cgi-bin/.../typo3-english

>


I see, you have to convert. This will be fun ;-)

Greetings
Lars

_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #8  
Alt 18.08.2008, 16:21
Dominique Feyer
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Le 18 août 08 à 13:26, Lars Haendler a écrit :

> I could send you a script I made for this purpose



Can you send me your script ? I go in holiday for 2 week tomorrow
evening, and my client need a clean DB during the next week

Thanks a lots,

Dominique

_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #9  
Alt 18.08.2008, 16:50
Lars Haendler
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] UTF8 in MySQL Database with a MySQL client in latin1

Dominique Feyer wrote:
>
> Le 18 août 08 à 13:26, Lars Haendler a écrit :
>
>> I could send you a script I made for this purpose

>
>
> Can you send me your script ? I go in holiday for 2 week tomorrow
> evening, and my client need a clean DB during the next week
>
> Thanks a lots,
>
> Dominique
>

Already sent.
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen

Thema Autor Forum Antworten Letzter Beitrag
[TYPO3] MySQL 5.1 error Lamb, Brian typo3-english@lists.netfielders.de 0 14.08.2008 14:35
[TYPO3] MySQL 5.1 error Lamb, Brian typo3-english@lists.netfielders.de 1 13.08.2008 21:42
[TYPO3] mysql function Nino Katic typo3-english@lists.netfielders.de 4 29.11.2007 11:32
[TYPO3-german] Your database connection failed (PHP zu MySQL -Problem) Ralph Hüttenmoser typo3-german@lists.netfielders.de 8 05.03.2007 16:43
Re: [TYPO3-german] Your database connection failed (PHP zu MySQL-Problem) Dirk Reichel typo3-german@lists.netfielders.de 0 26.02.2007 18:17


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:41 Uhr.


Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74