Problem displaying database query result in UTF8

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problem displaying database query result in UTF8

Postby Tiansen » 20. October 2006 17:02

I have configured Apache, PHP, MySQL to always use UTF8. I also have my data in MySQL encoded as UTF8 (phpMyAdmin displays it correctly). But when I import this data with PHP, I get data encoded in ISO-8859-1. So I see "?" instead of special characters. How is this possible? Have I forgot something?

Thank you very much for your help!
Tiansen
 
Posts: 6
Joined: 20. October 2006 16:52

Postby Izzy » 20. October 2006 20:40

Which php.ini file did you configure?

Is this the section in the php.ini file you configured?
Code: Select all
; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header.  To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Wiedmann » 20. October 2006 22:51

Have I forgot something?

I guess you don't have a "SET NAMES" query?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Tiansen » 31. October 2006 13:52

izzy: yes I used that section and set default charset to default-charset="utf-8"

Where is that mysql config file if I have default installation? I tried adding that SET NAMES thing in at least 2 different config files and it still doesn't work. :?
Tiansen
 
Posts: 6
Joined: 20. October 2006 16:52

Postby Izzy » 31. October 2006 14:07

If you mean the default php.ini file it is in:
xampp\apache\bin\php.ini

There is a my.ini file in my C:\Windows directory
and in:
xampp\mysql\bin there is a my file that shows as a link that you can drag into a text editor to read or edit the file.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Tiansen » 31. October 2006 14:14

No, I meant default mysql config file with mysqld section to add "SET NAMES" init query.

I have already edited PHP ini file that you mentioned with no avail.
Tiansen
 
Posts: 6
Joined: 20. October 2006 16:52

Postby Tiansen » 31. October 2006 14:16

Thank you for answer izzy. That is mysqld section in \Windows\my.ini:

[mysqld]
basedir=C:/Program Files/xampp/mysql
#bind-address=10.0.0.52
datadir=C:/Program Files/xampp/mysql/data
#language=C:/Program Files/xampp/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
init-connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci

I tried also this variant:
init-connect="SET NAMES utf-8"

And it still doesn't work.
Tiansen
 
Posts: 6
Joined: 20. October 2006 16:52

Postby Tiansen » 07. November 2006 15:04

Oh god, no clues? :shock:
Tiansen
 
Posts: 6
Joined: 20. October 2006 16:52


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 133 guests