Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
0 + 2 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Converting from latin1 to utf8
by ghia on 2010/1/27 1:02:27

For News and pdf see this.

Both backend and pdf were written in a time that latin1 and ISO-8859-1 was the norm for websites. These charactersets are asumed by the programs and as for RSS, mosttimes UTF-8 is required, backend converted to it, without wondering if it was already UTF-8 or not.

For the pdf class of News, I think I read on the developers site, that the class was not suitable to put UTF-8 in pdf.
Re: Converting from latin1 to utf8
by SMEDrieben on 2010/1/24 15:00:23

I converted my site from latin1 to utf8 (with a sql-dump), the above mentioned ALTER - queries and the changes in global.php and mainfile.php.

The result:
- my site is working perfectly ! All characters are given correctly.
- however, the rss-feeds and generated pdf's are terrible !!

Backend.php, backendt.php (News 1.64), rss.php (Extcal 2.2.2), rss.php (wfdownloads), makepdf (News 1.64) make terrible mistakes with special characters. Characters that are given correctly in my browser, they appear incorrect in the rss-feeds and makepdf !

I studied the php-code of backend.php and backendt.php: the charset is defined as utf-8.

How can I get those characters correct as well ??

SME Drieben
Re: Converting from latin1 to utf8
by SMEDrieben on 2010/1/16 13:44:13

Thanks !

I corrected the specifications in global.php (UTF-8) and mainfile.php (utf8). Thereafter, it works fine !

I didn't even correct my sql-dump: the previous changes were done in Notepad++: according to the program my file was already in UTF-8 without BOM.

SME Drieben
Re: Converting from latin1 to utf8
by ghia on 2010/1/16 13:00:10

I think you must dump in step 1 the database as ansi and then convert your SQL data dump file itself from ansi to UTF-8 without BOM, with eg Notepad++.
In mainfile the correct specification is uft8 and in global UTF-8.

But I'm not sure if this general approach could not disturb binary or array fields.
Converting from latin1 to utf8
by SMEDrieben on 2010/1/16 12:00:22

I am also trying to convert my system to UTF-8. Unfortunately, not completely succesful.

1) I made a sql-dump in UTF-8 without BOM format.
2) I changed CHARSET=latin1 to CHARSET=utf8 and COLLATE=utf8_general_ci to COLLATE=utf8_unicode_ci
3) I did the database query: ALTER DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
4) I reload my (changed) sql-dump in the database

Then my I went to global.php and mainfile.php to change $langcharset and 'XOOPS_DB_CHARSET' respectively.

If I change those 2 to "utf-8":
- newly entered information is displayed correctly
- special characters (e.g. éëä) from the sql-dump are NOT given correctly: the are shown as small squares.

If I change those 2 (in global.php an mainfile.php) to "utf8_general_ci":
- my old data from the sql-dump are given correctly;
- newly entered data (e.g. in Extcal or News) are terrible.

How can I solve this problem ?

Should I edit the sql-dump more extensively ? By what character should I replace chcracters such as ëäï: they are given in the sql-dump-file (UTF8 without BOM).

Thanks !

Drieben

Who's Online

158 user(s) are online (65 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits