[Phpmyadmin-devel] [ Exporting Relations Schema] Project

Piotr Przybylski piotr.prz at gmail.com
Tue Jun 22 21:33:06 CEST 2010


2010/6/22 ADnan <hiddenpearls at gmail.com>:
>
>
> On Wed, Jun 23, 2010 at 12:09 AM, Piotr Przybylski <piotr.prz at gmail.com>
> wrote:
>>
>> 2010/6/22 ADnan <hiddenpearls at gmail.com>:
>> >
>> >
>> > On Tue, Jun 22, 2010 at 11:55 PM, Marc Delisle <marc at infomarc.info>
>> > wrote:
>> >>
>> >> ADnan a écrit :
>> >> > hi,
>> >> >
>> >> > I am working with XMLWriter Extension for generating XML Documents
>> >> > for
>> >> > SVG,DIA,VISIO formats for generating schema .. but I noticed in
>> >> > XMLWriter .. this extension just provides utf-8 encoding ..
>> >>
>> >> I don't know much about this subject but please explain why generating
>> >> in utf-8 encoding is a problem.
>> >>
>> >
>> > This issue is making me think that there will be problem for generating
>> > the
>> > output in different languages ..
>>
>> Just make sure your data is in UTF-8, eg. use iconv() if the
>> connection is not sending you UTF-8 responses (or, if it is
>> unavailable, warn about it).
>>
> @Piotr I couldn't understand about the iconv() .. It is encoding conversion
> utility .. so, If XMLWriter deals data in utf-8 .. It would not be problem ?
>
> things are confusing still :(

Sorry, I will explain more clearly.

If your database connection uses UTF-8 encoding to return data
everything is ok. If you get responses in eg. latin1 encoding, use the
iconv extension (iconv() function) to convert encodings, eg.:
$latin1_data = 'some string';
$utf8_data = iconv('ISO-8859-1', 'UTF-8', $latin1_data);
Then, you feed UTF-8 data to XMLWriter.

It just occured to me that you can ensure that the data you get from
MySQL server is always in UTF-8. Instead of converting strings by
iconv, just change connection parameters and restore them after you
are done with schema export. I believe all MySQL installations should
have at least utf8_general_ci and utf8_bin collations available.

-- 
Piotr Przybylski




More information about the Developers mailing list