phpMyAdmin : convcharset, utf8 and iso-8859-15

phpMyAdmin : convcharset, utf8 and iso-8859-15

am 06.12.2005 15:11:54 von CapitaineEcarlate

Hy,

My website is hosted by Free.fr which offers MySQL control via
phpMyAdmin 2.6.3-pl1. That's great, but i have a little problem.

To follow the current stream and because my website is intended to be in
several languages, i decided to use utf8 encoding instead of
iso-8859-15. Everything works fine : the tables are in utf8, and PHP
handle it... But, phpMyAdmin seems to systematically convert data from
the Insert forms in iso-8859-1 before the table to be fed. I foud in the
source of the Insert page :

And, all text data is actually stored as iso instead of utf8.

If i do my own form to feed the table with correct utf8 data, i don't
encounter any problem. If i use the utf8_encode() PHP function, it fixes
the problem too. But... i'd like to feed the table with the help of
phpMyAdmin, but in true utf8.

Note that Free.fr offers MySQL 4.1.13.

Any idea ?
Do you know if it is an option of phpMyAdmin ?
Thanks !

CapitaineEcarlate

Re: phpMyAdmin : convcharset, utf8 and iso-8859-15

am 24.02.2006 06:56:27 von Jim Michaels

"CapitaineEcarlate" wrote in message
news:43959b76$0$4344$626a54ce@news.free.fr...
> Hy,
>
> My website is hosted by Free.fr which offers MySQL control via phpMyAdmin
> 2.6.3-pl1. That's great, but i have a little problem.
>
> To follow the current stream and because my website is intended to be in
> several languages, i decided to use utf8 encoding instead of iso-8859-15.
> Everything works fine : the tables are in utf8, and PHP handle it... But,
> phpMyAdmin seems to systematically convert data from the Insert forms in
> iso-8859-1 before the table to be fed. I foud in the source of the Insert
> page :
>
> And, all text data is actually stored as iso instead of utf8.
>
> If i do my own form to feed the table with correct utf8 data, i don't
> encounter any problem. If i use the utf8_encode() PHP function, it fixes
> the problem too. But... i'd like to feed the table with the help of
> phpMyAdmin, but in true utf8.
>
> Note that Free.fr offers MySQL 4.1.13.
>
> Any idea ?
> Do you know if it is an option of phpMyAdmin ?

not in the manual.

> Thanks !
>
> CapitaineEcarlate

Maybe I am not the one to be speaking (since I haven't looked inside
phpMyAdmin), but I don't think the problem is phpMyAdmin. utf-8 is a binary
stream. so the fields you use with it should be MySQL types like
VARBINARY() or BLOB() or TINYBLOB or MEDIUMBLOB.
as binary data, it should be hexcoded, or at least fed through addslashes()
before it ends up being fed to the db, or use the mysqli functions
[including mysqli_prepare()] and variable binding. I don't know what will
happen if a utf-8 stream ends up in SQL statements as table names. There is
a chance one of those bytes might happen to be a quote character. SQL is
ANSI, not utf-8 coded.

The problem you are having is not how do I put utf-8 text in, but instead,
how do I put a binary stream of data into a text field in phpMyAdmin. The
answer is, of course, you do a workaround. phpMyAdmin's text fields were
made to work with text, not binary data such as utf-8. that's the area you
are going to have to modify of course.

Re: phpMyAdmin : convcharset, utf8 and iso-8859-15

am 25.02.2006 00:36:01 von Jim Michaels

"Jim Michaels" wrote in message
news:zu2dnbK4KtPIPmPenZ2dneKdnZydnZ2d@comcast.com...
>
> "CapitaineEcarlate" wrote in message
> news:43959b76$0$4344$626a54ce@news.free.fr...
>> Hy,
>>
>> My website is hosted by Free.fr which offers MySQL control via phpMyAdmin
>> 2.6.3-pl1. That's great, but i have a little problem.
>>
>> To follow the current stream and because my website is intended to be in
>> several languages, i decided to use utf8 encoding instead of iso-8859-15.
>> Everything works fine : the tables are in utf8, and PHP handle it... But,
>> phpMyAdmin seems to systematically convert data from the Insert forms in
>> iso-8859-1 before the table to be fed. I foud in the source of the Insert
>> page :
>>
>> And, all text data is actually stored as iso instead of utf8.
>>
>> If i do my own form to feed the table with correct utf8 data, i don't
>> encounter any problem. If i use the utf8_encode() PHP function, it fixes
>> the problem too. But... i'd like to feed the table with the help of
>> phpMyAdmin, but in true utf8.
>>
>> Note that Free.fr offers MySQL 4.1.13.

in PHPMyAdmin you can set the collation (charset), but you are limited to
what tthe database can handle. you can set a specific language, but that
doesn't include utf-8. I looked in MySQL's share directory.

>>
>> Any idea ?
>> Do you know if it is an option of phpMyAdmin ?
>
> not in the manual.
>
>> Thanks !
>>
>> CapitaineEcarlate
>
> Maybe I am not the one to be speaking (since I haven't looked inside
> phpMyAdmin), but I don't think the problem is phpMyAdmin. utf-8 is a
> binary stream. so the fields you use with it should be MySQL types like
> VARBINARY() or BLOB() or TINYBLOB or MEDIUMBLOB.
> as binary data, it should be hexcoded, or at least fed through
> addslashes() before it ends up being fed to the db, or use the mysqli
> functions [including mysqli_prepare()] and variable binding. I don't know
> what will happen if a utf-8 stream ends up in SQL statements as table
> names. There is a chance one of those bytes might happen to be a quote
> character. SQL is ANSI, not utf-8 coded.
>
> The problem you are having is not how do I put utf-8 text in, but instead,
> how do I put a binary stream of data into a text field in phpMyAdmin. The
> answer is, of course, you do a workaround. phpMyAdmin's text fields were
> made to work with text, not binary data such as utf-8. that's the area
> you are going to have to modify of course.
>

Re: phpMyAdmin : convcharset, utf8 and iso-8859-15

am 25.02.2006 01:12:41 von Jim Michaels

"CapitaineEcarlate" wrote in message
news:43959b76$0$4344$626a54ce@news.free.fr...
> Hy,
>
> My website is hosted by Free.fr which offers MySQL control via phpMyAdmin
> 2.6.3-pl1. That's great, but i have a little problem.
>
> To follow the current stream and because my website is intended to be in
> several languages, i decided to use utf8 encoding instead of iso-8859-15.
> Everything works fine : the tables are in utf8, and PHP handle it... But,
> phpMyAdmin seems to systematically convert data from the Insert forms in
> iso-8859-1 before the table to be fed. I foud in the source of the Insert
> page :
>
> And, all text data is actually stored as iso instead of utf8.
>
> If i do my own form to feed the table with correct utf8 data, i don't
> encounter any problem. If i use the utf8_encode() PHP function, it fixes
> the problem too. But... i'd like to feed the table with the help of
> phpMyAdmin, but in true utf8.
>
> Note that Free.fr offers MySQL 4.1.13.
>
> Any idea ?
> Do you know if it is an option of phpMyAdmin ?

As usual, I prove myself wrong. I found something in the documentation.txt
and config.default.php that comes in the package. and in
$cfg['AvailableCharsets'] is an array that includes 'utf-8'.

$cfg['DefaultLang'] string
Defines the default language to use, if not browser-defined or
user-defined.
See the select_lang.lib.php script to know the valid values for
this
setting.

$cfg['Lang'] string
Force: always use this language (must be defined in the
select_lang.lib.php script).

$cfg['FilterLanguages'] string
Limit list of available languages to those matching the given
regular
expression. For example if you want only Czech and English, you
should set filter to '^(cs|en)'.

$cfg['DefaultCharset'] string
Default character set to use for recoding of MySQL queries. This
must
be enabled and it's described by $cfg['AllowAnywhereRecoding']
option.
You can give here any character set which is in
$cfg['AvailableCharsets'] array and this is just default choice,
user
can select any of them.

$cfg['AllowAnywhereRecoding'] boolean
Allow character set recoding of MySQL queries. You need recode or
iconv support (compiled in or module) in PHP to allow MySQL
queries
recoding and used language file must have it enabled (by default
only
these which are in Unicode, just to avoid losing some characters).
Setting this to TRUE also activates a pull-down menu in the Export
page, to choose the character set when exporting a file.

$cfg['RecodingEngine'] string
You can select here which functions will be used for character set
conversion. Possible values are:

+ auto - automatically use available one (first is tested iconv,
then
recode)
+ iconv - use iconv or libiconv functions
+ recode - use recode_string function

Default is auto.

$cfg['IconvExtraParams'] string
Specify some parameters for iconv used in charset conversion. See
iconv documentation for details.

$cfg['AvailableCharsets'] array
Available character sets for MySQL conversion. You can add your
own
(any of supported by recode/iconv) or remove these which you don't
use. Character sets will be shown in same order as here listed, so
if
you frequently use some of these move them to the top.

[5.11] Extended-ASCII characters like German umlauts are displayed
wrong.

Please ensure that you have set your browser's character set to the one o
f the language file you have selected on phpMyAdmin's start page. Altern
atively, you can try the auto detection mode that is supported by the re
cent versions of the most browsers.

[5.12] Apple OS X: Safari browser changes special characters to "?".

This issue has been reported by a OS X user, who adds that Chimera, Netsc
ape and Mozilla do not have this problem.







> Thanks !
>
> CapitaineEcarlate