You are here: MySQL character sets « PHP Programming Language « IT news, forums, messages
MySQL character sets

Posted by Marcus on 06/26/06 23:26

Hello,

I recently upgraded from 4.0 to 4.1. I've spent the last few days
reading up on charsets since I never really thought about it when I used
4.0. I thought I had most of it figured out, but then I saw this in
phpMyAdmin and am as confused as when I started:

MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8-unicode-ci (in a dropdown box)

I know that with 4.1, the default charset for tables is latin1, and the
default collation is latin1_swedish_ci. Why would these default to
latin1, but then my server and connection default to utf-8? I might be
totally off base but I would have thought the default for each would be
the same charset...

Also, is this why queries entered into phpMyAdmin such as:

UPDATE ...
SET ...
WHERE `fieldname` = 'test'

now automatically get converted to:

UPDATE ...
SET ...
WHERE CONVERT( `fieldname` USING utf8 ) = 'test'

From all the online documentation I have been reading, it seems that
ideally I would convert my whole system over to use utf-8... practically
speaking, however, I would rather not, as I really only have the need to
store ASCII characters and after upgrading have altered my data
validation functions to check for ASCII. Given this and what I have
provided above, would it be allright for me to leave everything as is
(defaulted), or do I need to alter anything with any of my charsets?
For example, I have not changed any of my queries to reflect the
phpMyAdmin added syntax above, but everything seems to still work ok.
Dealing with these charsets is still new to me, and I'm not sure what
else I can get out of these tutorials (I currently have 34 firefox
windows open), so I thank you all very much for any help you can provide.

- Marcus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация