Foreign Characters Break in MySQL

Foreign Characters Break in MySQL

am 22.01.2010 02:04:27 von Ryan Park

--_f9d32919-d309-4c40-b67a-d13a6d5ead59_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable


Hello I'm currently trying to use PHP to insert foreign characters into one=
of the mysql database tables.mysql_query() worked seamlessly=2C but when I=
check the inserted data on phpMyAdmin it shows the foreign characters in b=
roken letters=2C like this 시í=8C <- jibberish...The foreign chara=
cters show fine when I'm typing it out on my editor to code PHP=2C but it g=
ets broken into unrecognizable symbols when put into mysql database columns=
..
I tried to create the same thing this time through phpMyAdmin console and i=
t worked great=2C the foreign characters showed correctly as they should.Th=
e column that I'm trying to put the foreign characters into is set as utf8_=
general_ci.I wish to use PHP to insert the data into the database because I=
'll be inserting massive amounts of them at once=2C so I just can't continu=
e with this problem at hand.
I'll greatly appreciate any help=2C thank you. =20
____________________________________________________________ _____
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/196390709/direct/01/=

--_f9d32919-d309-4c40-b67a-d13a6d5ead59_--

Re: Foreign Characters Break in MySQL

am 22.01.2010 02:19:27 von List Manager

Ryan Park wrote:
> Hello I'm currently trying to use PHP to insert foreign characters into one of the mysql database tables.mysql_query() worked seamlessly, but when I check the inserted data on phpMyAdmin it shows the foreign characters in broken letters, like this ì‹œíŒ <- jibberish...The foreign characters show fine when I'm typing it out on my editor to code PHP, but it gets broken into unrecognizable symbols when put into mysql database columns.
> I tried to create the same thing this time through phpMyAdmin console and it worked great, the foreign characters showed correctly as they should.The column that I'm trying to put the foreign characters into is set as utf8_general_ci.I wish to use PHP to insert the data into the database because I'll be inserting massive amounts of them at once, so I just can't continue with this problem at hand.
> I'll greatly appreciate any help, thank you.
> ____________________________________________________________ _____
> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
> http://clk.atdmt.com/GBL/go/196390709/direct/01/

How about showing a little of the insert code. ie: how you are gathering the
data, how you are preping the data, and the actual insert statement.

--
Jim Lucas
NOC Manager
541-323-9113
BendTel, Inc.
http://www.bendtel.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 02:28:38 von Ryan Park

Forgot to reply all.

You can see that it's in the middle of the sql statement.
It looks fine here but some how it breaks during the query.

mysql_connect("localhost", "adminID", "password") or die(mysql_error());
echo "Connected to MySQL
";

mysql_select_db("databasename") or die(mysql_error());
echo "Connected to Database
";

$sql = "INSERT INTO xe_modules (module_srl, module, module_category_srl,
layout_srl, menu_srl, site_srl, mid, skin, browser_title, description,
is_default, content, open_rss, header_text, footer_text, regdate) VALUES
('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', '자유게시판
', '', 'N', '', 'Y', '', '', UNIX_TIMESTAMP());";

mysql_query($sql) or die(mysql_error());

mysql_close();
?>

On 1/21/2010 5:19 PM, Jim Lucas wrote:
> Ryan Park wrote:
>
>> Hello I'm currently trying to use PHP to insert foreign characters into one of the mysql database tables.mysql_query() worked seamlessly, but when I check the inserted data on phpMyAdmin it shows the foreign characters in broken letters, like this ì‹œíŒ<- jibberish...The foreign characters show fine when I'm typing it out on my editor to code PHP, but it gets broken into unrecognizable symbols when put into mysql database columns.
>> I tried to create the same thing this time through phpMyAdmin console and it worked great, the foreign characters showed correctly as they should.The column that I'm trying to put the foreign characters into is set as utf8_general_ci.I wish to use PHP to insert the data into the database because I'll be inserting massive amounts of them at once, so I just can't continue with this problem at hand.
>> I'll greatly appreciate any help, thank you.
>> ____________________________________________________________ _____
>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
>> http://clk.atdmt.com/GBL/go/196390709/direct/01/
>>
> How about showing a little of the insert code. ie: how you are gathering the
> data, how you are preping the data, and the actual insert statement.
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 03:41:56 von Eric Lee

--0016e68de85d50467e047db7c378
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, all,

I'am not able test it out now.
Did you tried to change the collation to utf8_bin from utf8_general_ci ?


Eric,
Regards,


On 1/22/10, Ryan Park wrote:
>
> Forgot to reply all.
>
> You can see that it's in the middle of the sql statement.
> It looks fine here but some how it breaks during the query.
>
> > mysql_connect("localhost", "adminID", "password") or die(mysql_error());
> echo "Connected to MySQL
";
>
> mysql_select_db("databasename") or die(mysql_error());
> echo "Connected to Database
";
>
> $sql =3D "INSERT INTO xe_modules (module_srl, module, module_category_srl=
,
> layout_srl, menu_srl, site_srl, mid, skin, browser_title, description,
> is_default, content, open_rss, header_text, footer_text, regdate) VALUES
> ('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', '자ì=
œ ê²Œì‹œíŒ=90 ', '',
> 'N', '', 'Y', '', '', UNIX_TIMESTAMP());";
>
> mysql_query($sql) or die(mysql_error());
>
> mysql_close();
> ?>
>
> On 1/21/2010 5:19 PM, Jim Lucas wrote:
>
>> Ryan Park wrote:
>>
>>
>>> Hello I'm currently trying to use PHP to insert foreign characters into
>>> one of the mysql database tables.mysql_query() worked seamlessly, but w=
hen I
>>> check the inserted data on phpMyAdmin it shows the foreign characters i=
n
>>> broken letters, like this ì‹œíÅ=92<- jibberish=
....The foreign characters show
>>> fine when I'm typing it out on my editor to code PHP, but it gets broke=
n
>>> into unrecognizable symbols when put into mysql database columns.
>>> I tried to create the same thing this time through phpMyAdmin console a=
nd
>>> it worked great, the foreign characters showed correctly as they should=
..The
>>> column that I'm trying to put the foreign characters into is set as
>>> utf8_general_ci.I wish to use PHP to insert the data into the database
>>> because I'll be inserting massive amounts of them at once, so I just ca=
n't
>>> continue with this problem at hand.
>>> I'll greatly appreciate any help, thank you.
>>>
>>> ____________________________________________________________ _____
>>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
>>> http://clk.atdmt.com/GBL/go/196390709/direct/01/
>>>
>>>
>> How about showing a little of the insert code. ie: how you are gatherin=
g
>> the
>> data, how you are preping the data, and the actual insert statement.
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--0016e68de85d50467e047db7c378--

Re: Foreign Characters Break in MySQL

am 22.01.2010 03:47:52 von Jochem Maas

Op 1/22/10 2:28 AM, Ryan Park schreef:
> Forgot to reply all.
>
> You can see that it's in the middle of the sql statement.
> It looks fine here but some how it breaks during the query.
>
> > mysql_connect("localhost", "adminID", "password") or die(mysql_error());
> echo "Connected to MySQL
";
>
> mysql_select_db("databasename") or die(mysql_error());
> echo "Connected to Database
";
>
> $sql = "INSERT INTO xe_modules (module_srl, module, module_category_srl,
> layout_srl, menu_srl, site_srl, mid, skin, browser_title, description,
> is_default, content, open_rss, header_text, footer_text, regdate) VALUES
> ('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', '자유게시판
> ', '', 'N', '', 'Y', '', '', UNIX_TIMESTAMP());";

you need to:

1. have some understanding of char encoding and character sets.
2. define you DB[tables] to use a collation that supports the stuff you want to enter.
3. you need to connect to the DB with a suitable charset (google 'SET NAMES')
4. you need to make sure the data you are putting into your queries is in that same charset.

basically you need UTF8 - be prepared for some pain and a lot of reading in order
to get to grips with these concepts, I've personally found that encoding, charsets et al
are not the easiest things to one's head round.

>
> mysql_query($sql) or die(mysql_error());
>
> mysql_close();
> ?>
>
> On 1/21/2010 5:19 PM, Jim Lucas wrote:
>> Ryan Park wrote:
>>
>>> Hello I'm currently trying to use PHP to insert foreign characters
>>> into one of the mysql database tables.mysql_query() worked
>>> seamlessly, but when I check the inserted data on phpMyAdmin it shows
>>> the foreign characters in broken letters, like this ì‹œíŒ<-
>>> jibberish...The foreign characters show fine when I'm typing it out
>>> on my editor to code PHP, but it gets broken into unrecognizable
>>> symbols when put into mysql database columns.
>>> I tried to create the same thing this time through phpMyAdmin console
>>> and it worked great, the foreign characters showed correctly as they
>>> should.The column that I'm trying to put the foreign characters into
>>> is set as utf8_general_ci.I wish to use PHP to insert the data into
>>> the database because I'll be inserting massive amounts of them at
>>> once, so I just can't continue with this problem at hand.
>>> I'll greatly appreciate any help, thank you.
>>> ____________________________________________________________ _____
>>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
>>> http://clk.atdmt.com/GBL/go/196390709/direct/01/
>>>
>> How about showing a little of the insert code. ie: how you are
>> gathering the
>> data, how you are preping the data, and the actual insert statement.
>>
>>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 09:41:29 von Ashley Sheridan

--=-FEd0OZDa/T2u9Ud1fC5I
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2010-01-22 at 03:47 +0100, Jochem Maas wrote:

> Op 1/22/10 2:28 AM, Ryan Park schreef:
> > Forgot to reply all.
> >=20
> > You can see that it's in the middle of the sql statement.
> > It looks fine here but some how it breaks during the query.
> >=20
> > > > mysql_connect("localhost", "adminID", "password") or die(mysql_error())=
;
> > echo "Connected to MySQL
";
> >=20
> > mysql_select_db("databasename") or die(mysql_error());
> > echo "Connected to Database
";
> >=20
> > $sql =3D "INSERT INTO xe_modules (module_srl, module, module_category_s=
rl,
> > layout_srl, menu_srl, site_srl, mid, skin, browser_title, description,
> > is_default, content, open_rss, header_text, footer_text, regdate) VALUE=
S
> > ('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', 'ìž=90=
유게시판
> > ', '', 'N', '', 'Y', '', '', UNIX_TIMESTAMP());";
>=20
> you need to:
>=20
> 1. have some understanding of char encoding and character sets.
> 2. define you DB[tables] to use a collation that supports the stuff you w=
ant to enter.
> 3. you need to connect to the DB with a suitable charset (google 'SET NAM=
ES')
> 4. you need to make sure the data you are putting into your queries is in=
that same charset.
>=20
> basically you need UTF8 - be prepared for some pain and a lot of reading =
in order
> to get to grips with these concepts, I've personally found that encoding,=
charsets et al
> are not the easiest things to one's head round.
>=20
> >=20
> > mysql_query($sql) or die(mysql_error());
> >=20
> > mysql_close();
> > ?>
> >=20
> > On 1/21/2010 5:19 PM, Jim Lucas wrote:
> >> Ryan Park wrote:
> >> =20
> >>> Hello I'm currently trying to use PHP to insert foreign characters
> >>> into one of the mysql database tables.mysql_query() worked
> >>> seamlessly, but when I check the inserted data on phpMyAdmin it shows
> >>> the foreign characters in broken letters, like this ìâ€=B9=
œíŒ<-
> >>> jibberish...The foreign characters show fine when I'm typing it out
> >>> on my editor to code PHP, but it gets broken into unrecognizable
> >>> symbols when put into mysql database columns.
> >>> I tried to create the same thing this time through phpMyAdmin console
> >>> and it worked great, the foreign characters showed correctly as they
> >>> should.The column that I'm trying to put the foreign characters into
> >>> is set as utf8_general_ci.I wish to use PHP to insert the data into
> >>> the database because I'll be inserting massive amounts of them at
> >>> once, so I just can't continue with this problem at hand.
> >>> I'll greatly appreciate any help, thank you. =20
> >>> ____________________________________________________________ _____
> >>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
> >>> http://clk.atdmt.com/GBL/go/196390709/direct/01/
> >>> =20
> >> How about showing a little of the insert code. ie: how you are
> >> gathering the
> >> data, how you are preping the data, and the actual insert statement.
> >>
> >> =20
> >=20
>=20
>=20


You're also forgetting one of the most important elements of this. If
you're displaying the characters on a web page, chances are that you
need to add a corresponding meta tag to inform the browser that the
content is utf-8



Otherwise the browser will attempt to guess from the first few
characters of output, and because of the large headers in some websites,
will guess completely wrong.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-FEd0OZDa/T2u9Ud1fC5I--

Re: Foreign Characters Break in MySQL

am 22.01.2010 10:53:42 von Michael Peters

Ashley Sheridan wrote:

>
>
> You're also forgetting one of the most important elements of this. If
> you're displaying the characters on a web page, chances are that you
> need to add a corresponding meta tag to inform the browser that the
> content is utf-8
>
>
>
> Otherwise the browser will attempt to guess from the first few
> characters of output, and because of the large headers in some websites,
> will guess completely wrong.

Just to add - I had to deal with this, I think I got it right now but
I'm not positive.

My /etc/my.cnf file has the following:

default-character-set=utf8

That way I don't have to remember to specify the charset when I create a
new table.

If you don't have control over that file (IE shared host) when you
create your database tables, I believe you need to do

SET character_set_client = utf8;

before your create table commands.

You should also send the charset in a header, IE

header('Content-type: text/html; charset=utf-8');

but for html you also need to have the meta tag as mentioned because if
the page is saved to disk, there's no other way for a browser to know
the charset (and if it isn't there, w3c validator complains).

proper xhtml doesn't need the meta tag because it has the charset in the

that opens a proper xhtml document.

If the charset isn't set, then any information sent via post will
probably be sent using whatever charset the operating system uses by
default, so setting the charset to utf-8 is important for pages that are
forms as well as pages that display data.

I'm by no means an expert, that's just what I had to do to get
Aneides iëcanus
to properly display.

I already was doing the utf-8 for the web pages, but MySQL defaults to a
different character set - I consider it a CentOS bug, they should have
shipped with my.cnf set to utf-8 IMHO because just about everything else
in the OS is utf-8 by default, but I pulled my hair out for half an hour
trying to figure out why it wasn't working when the reason was the
default charset of the MySQL client used to initially create the
database table.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 11:33:31 von Ryan Park

Thank you all for the helpful comments.
I've finally solved the problem through sql command "set name."

On 1/22/2010 1:53 AM, Michael A. Peters wrote:
> Ashley Sheridan wrote:
>
>>
>>
>> You're also forgetting one of the most important elements of this. If
>> you're displaying the characters on a web page, chances are that you
>> need to add a corresponding meta tag to inform the browser that the
>> content is utf-8
>>
>>
>>
>> Otherwise the browser will attempt to guess from the first few
>> characters of output, and because of the large headers in some websites,
>> will guess completely wrong.
>
> Just to add - I had to deal with this, I think I got it right now but
> I'm not positive.
>
> My /etc/my.cnf file has the following:
>
> default-character-set=utf8
>
> That way I don't have to remember to specify the charset when I create
> a new table.
>
> If you don't have control over that file (IE shared host) when you
> create your database tables, I believe you need to do
>
> SET character_set_client = utf8;
>
> before your create table commands.
>
> You should also send the charset in a header, IE
>
> header('Content-type: text/html; charset=utf-8');
>
> but for html you also need to have the meta tag as mentioned because
> if the page is saved to disk, there's no other way for a browser to
> know the charset (and if it isn't there, w3c validator complains).
>
> proper xhtml doesn't need the meta tag because it has the charset in the
>
> that opens a proper xhtml document.
>
> If the charset isn't set, then any information sent via post will
> probably be sent using whatever charset the operating system uses by
> default, so setting the charset to utf-8 is important for pages that
> are forms as well as pages that display data.
>
> I'm by no means an expert, that's just what I had to do to get
> Aneides iëcanus
> to properly display.
>
> I already was doing the utf-8 for the web pages, but MySQL defaults to
> a different character set - I consider it a CentOS bug, they should
> have shipped with my.cnf set to utf-8 IMHO because just about
> everything else in the OS is utf-8 by default, but I pulled my hair
> out for half an hour trying to figure out why it wasn't working when
> the reason was the default charset of the MySQL client used to
> initially create the database table.
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 17:15:26 von Jochem Maas

Op 1/22/10 9:41 AM, Ashley Sheridan schreef:
> On Fri, 2010-01-22 at 03:47 +0100, Jochem Maas wrote:
>
>> Op 1/22/10 2:28 AM, Ryan Park schreef:
>>> Forgot to reply all.
>>>
>>> You can see that it's in the middle of the sql statement.
>>> It looks fine here but some how it breaks during the query.
>>>
>>> >>> mysql_connect("localhost", "adminID", "password") or die(mysql_error());
>>> echo "Connected to MySQL
";
>>>
>>> mysql_select_db("databasename") or die(mysql_error());
>>> echo "Connected to Database
";
>>>
>>> $sql = "INSERT INTO xe_modules (module_srl, module, module_category_srl,
>>> layout_srl, menu_srl, site_srl, mid, skin, browser_title, description,
>>> is_default, content, open_rss, header_text, footer_text, regdate) VALUES
>>> ('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', '자유게시판
>>> ', '', 'N', '', 'Y', '', '', UNIX_TIMESTAMP());";
>>
>> you need to:
>>
>> 1. have some understanding of char encoding and character sets.
>> 2. define you DB[tables] to use a collation that supports the stuff you want to enter.
>> 3. you need to connect to the DB with a suitable charset (google 'SET NAMES')
>> 4. you need to make sure the data you are putting into your queries is in that same charset.
>>
>> basically you need UTF8 - be prepared for some pain and a lot of reading in order
>> to get to grips with these concepts, I've personally found that encoding, charsets et al
>> are not the easiest things to one's head round.
>>
>>>
>>> mysql_query($sql) or die(mysql_error());
>>>
>>> mysql_close();
>>> ?>
>>>
>>> On 1/21/2010 5:19 PM, Jim Lucas wrote:
>>>> Ryan Park wrote:
>>>>
>>>>> Hello I'm currently trying to use PHP to insert foreign characters
>>>>> into one of the mysql database tables.mysql_query() worked
>>>>> seamlessly, but when I check the inserted data on phpMyAdmin it shows
>>>>> the foreign characters in broken letters, like this ì‹œíŒ<-
>>>>> jibberish...The foreign characters show fine when I'm typing it out
>>>>> on my editor to code PHP, but it gets broken into unrecognizable
>>>>> symbols when put into mysql database columns.
>>>>> I tried to create the same thing this time through phpMyAdmin console
>>>>> and it worked great, the foreign characters showed correctly as they
>>>>> should.The column that I'm trying to put the foreign characters into
>>>>> is set as utf8_general_ci.I wish to use PHP to insert the data into
>>>>> the database because I'll be inserting massive amounts of them at
>>>>> once, so I just can't continue with this problem at hand.
>>>>> I'll greatly appreciate any help, thank you.
>>>>> ____________________________________________________________ _____
>>>>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
>>>>> http://clk.atdmt.com/GBL/go/196390709/direct/01/
>>>>>
>>>> How about showing a little of the insert code. ie: how you are
>>>> gathering the
>>>> data, how you are preping the data, and the actual insert statement.
>>>>
>>>>
>>>
>>
>>
>
>
> You're also forgetting one of the most important elements of this. If
> you're displaying the characters on a web page, chances are that you
> need to add a corresponding meta tag to inform the browser that the
> content is utf-8
>
>
>
> Otherwise the browser will attempt to guess from the first few
> characters of output, and because of the large headers in some websites,
> will guess completely wrong.

that was point 4. in my original post, I'd also say that the META tag is a bit
lame on it's own ... better off actually setting the proper content encoding HTTP header
(and using the META tag as well to cover for dumb ass browsers)

>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 17:18:47 von Ashley Sheridan

On Fri, 2010-01-22 at 17:15 +0100, Jochem Maas wrote:
> Op 1/22/10 9:41 AM, Ashley Sheridan schreef:
> > On Fri, 2010-01-22 at 03:47 +0100, Jochem Maas wrote:
> >=20
> >> Op 1/22/10 2:28 AM, Ryan Park schreef:
> >>> Forgot to reply all.
> >>>
> >>> You can see that it's in the middle of the sql statement.
> >>> It looks fine here but some how it breaks during the query.
> >>>
> >>> > >>> mysql_connect("localhost", "adminID", "password") or die(mysql_error(=
));
> >>> echo "Connected to MySQL
";
> >>>
> >>> mysql_select_db("databasename") or die(mysql_error());
> >>> echo "Connected to Database
";
> >>>
> >>> $sql =3D "INSERT INTO xe_modules (module_srl, module, module_category=
_srl,
> >>> layout_srl, menu_srl, site_srl, mid, skin, browser_title, description=
,
> >>> is_default, content, open_rss, header_text, footer_text, regdate) VAL=
UES
> >>> ('135', 'bodex', '0', '53', '0', '0', 'free', 'xe_default', 'ìž=
ìœ ê²Œì‹œíŒ=90
> >>> ', '', 'N', '', 'Y', '', '', UNIX_TIMESTAMP());";
> >>
> >> you need to:
> >>
> >> 1. have some understanding of char encoding and character sets.
> >> 2. define you DB[tables] to use a collation that supports the stuff yo=
u want to enter.
> >> 3. you need to connect to the DB with a suitable charset (google 'SET =
NAMES')
> >> 4. you need to make sure the data you are putting into your queries is=
in that same charset.
> >>
> >> basically you need UTF8 - be prepared for some pain and a lot of readi=
ng in order
> >> to get to grips with these concepts, I've personally found that encodi=
ng, charsets et al
> >> are not the easiest things to one's head round.
> >>
> >>>
> >>> mysql_query($sql) or die(mysql_error());
> >>>
> >>> mysql_close();
> >>> ?>
> >>>
> >>> On 1/21/2010 5:19 PM, Jim Lucas wrote:
> >>>> Ryan Park wrote:
> >>>> =20
> >>>>> Hello I'm currently trying to use PHP to insert foreign characters
> >>>>> into one of the mysql database tables.mysql_query() worked
> >>>>> seamlessly, but when I check the inserted data on phpMyAdmin it sho=
ws
> >>>>> the foreign characters in broken letters, like this ìâ€=B9=
œíŒ<-
> >>>>> jibberish...The foreign characters show fine when I'm typing it out
> >>>>> on my editor to code PHP, but it gets broken into unrecognizable
> >>>>> symbols when put into mysql database columns.
> >>>>> I tried to create the same thing this time through phpMyAdmin conso=
le
> >>>>> and it worked great, the foreign characters showed correctly as the=
y
> >>>>> should.The column that I'm trying to put the foreign characters int=
o
> >>>>> is set as utf8_general_ci.I wish to use PHP to insert the data into
> >>>>> the database because I'll be inserting massive amounts of them at
> >>>>> once, so I just can't continue with this problem at hand.
> >>>>> I'll greatly appreciate any help, thank you. =
=20
> >>>>> ____________________________________________________________ _____
> >>>>> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
> >>>>> http://clk.atdmt.com/GBL/go/196390709/direct/01/
> >>>>> =20
> >>>> How about showing a little of the insert code. ie: how you are
> >>>> gathering the
> >>>> data, how you are preping the data, and the actual insert statement.
> >>>>
> >>>> =20
> >>>
> >>
> >>
> >=20
> >=20
> > You're also forgetting one of the most important elements of this. If
> > you're displaying the characters on a web page, chances are that you
> > need to add a corresponding meta tag to inform the browser that the
> > content is utf-8
> >=20
> > "/>
> >=20
> > Otherwise the browser will attempt to guess from the first few
> > characters of output, and because of the large headers in some websites=
,
> > will guess completely wrong.
>=20
> that was point 4. in my original post, I'd also say that the META tag is =
a bit
> lame on it's own ... better off actually setting the proper content encod=
ing HTTP header
> (and using the META tag as well to cover for dumb ass browsers)
>=20
> >=20
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >=20
> >=20
> >=20
>=20
>=20

You'd be surprised how many people still use a dumb browser!

Thankfully though, it seems that people are wising up a bit more, as
these stats from a media website show:

Safari 4 2624
Firefox 3.5 1320
Firefox 3 690
IE 8 501
IE 6 465
IE 7 417
Safari 3.2 171
Firefox 2 151
Mozilla 1.9 109
Unknown 0 56
Safari 3.1 53
Chrome 3 34
Safari 3 19
Google Webmaster Tools 0 7
Flock 2 5
Opera 10 1

This is a media-based website, which would explain the large use of
browsers available for the Mac, but I still take it as a good sign.

Thanks,
Ash
http://www.ashleysheridan.co.uk




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 18:04:43 von TedD

At 4:18 PM +0000 1/22/10, Ashley Sheridan wrote:
>
>You'd be surprised how many people still use a dumb browser!
>
>Thankfully though, it seems that people are wising up a bit more, as
>these stats from a media website show:
>
>Safari 4 2624
>Firefox 3.5 1320
>Firefox 3 690
>IE 8 501
>IE 6 465
>IE 7 417
>Safari 3.2 171
>Firefox 2 151
>Mozilla 1.9 109
>Unknown 0 56
>Safari 3.1 53
>Chrome 3 34
>Safari 3 19
>Google Webmaster Tools 0 7
>Flock 2 5
>Opera 10 1
>
>This is a media-based website, which would explain the large use of
>browsers available for the Mac, but I still take it as a good sign.
>
>Thanks,
>Ash


Ash:

As you know, stats really depend upon the site tested. I have one
site where over 99 percent of the visitors are Mac users (over 120
unique visitors each day).

The following link I think provides more typical browser selection stats.

http://www.w3schools.com/browsers/browsers_stats.asp

Fortunately IE6 is on the way out (good riddance) and other IE's are
losing ground (Woo Hoo!).

More browser developers are trying to adhere to standards rather than
fighting them like M$ does. As I see it, it always takes M$ a little
more time to learn anything worthwhile.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Foreign Characters Break in MySQL

am 22.01.2010 18:06:28 von Ashley Sheridan

--=-qAlhj+fkHED0XQPs1aVL
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Fri, 2010-01-22 at 12:04 -0500, tedd wrote:

> At 4:18 PM +0000 1/22/10, Ashley Sheridan wrote:
> >
> >You'd be surprised how many people still use a dumb browser!
> >
> >Thankfully though, it seems that people are wising up a bit more, as
> >these stats from a media website show:
> >
> >Safari 4 2624
> >Firefox 3.5 1320
> >Firefox 3 690
> >IE 8 501
> >IE 6 465
> >IE 7 417
> >Safari 3.2 171
> >Firefox 2 151
> >Mozilla 1.9 109
> >Unknown 0 56
> >Safari 3.1 53
> >Chrome 3 34
> >Safari 3 19
> >Google Webmaster Tools 0 7
> >Flock 2 5
> >Opera 10 1
> >
> >This is a media-based website, which would explain the large use of
> >browsers available for the Mac, but I still take it as a good sign.
> >
> >Thanks,
> >Ash
>
>
> Ash:
>
> As you know, stats really depend upon the site tested. I have one
> site where over 99 percent of the visitors are Mac users (over 120
> unique visitors each day).
>
> The following link I think provides more typical browser selection stats.
>
> http://www.w3schools.com/browsers/browsers_stats.asp
>
> Fortunately IE6 is on the way out (good riddance) and other IE's are
> losing ground (Woo Hoo!).
>
> More browser developers are trying to adhere to standards rather than
> fighting them like M$ does. As I see it, it always takes M$ a little
> more time to learn anything worthwhile.
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>


I agree that stats vary from site to site, I was just picking one I had
my own tracking on that wasn't of a technical persuasion. W3C admits
themselves that their stats are probably tainted by the technical
experience of its visitors.

I don't want to hijack this thread so I won't go into anything that
would spur a mass debate! (don't read those last two words aloud too
quickly!)

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-qAlhj+fkHED0XQPs1aVL--

Re: Foreign Characters Break in MySQL

am 22.01.2010 18:24:35 von Jochem Maas

Op 1/22/10 5:18 PM, Ashley Sheridan schreef:

....

>
> You'd be surprised how many people still use a dumb browser!

well, no not really - but then we're in the same business :)
I wasn't discounting the use of the encoding META tag, just pointing
out that it's a hack we have to use (and that we should be using it in addition
to setting proper encoding HTTP headers)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php