Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default EXACT collation please?

    Installing a fresh 1.5

    I've had problems in the past with foreign chars not displaying correctly in some areas. So from the beginning I want the correct settings. I have customers from around the globe entering addresses the way THEY want to and I need it to record correctly.

    During setup it asks me to choose between UTF-8 and Latin1, but when I'm creating the database I get dozens of options. So utf8_general_ci? utf8_bin_ci? utf8_unicode_ci? latin1_bin_ci? latin1_general_ci? latin1_general_cs?

    - Steven

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: EXACT collation please?

    If you're using UTF8, then the preferred collation to use when CREATING A *NEW* DATABASE is utf8_general_ci or utf8_unicode_ci

    For Latin1/iso-8859-1 you want latin1_general_ci

    Basically you want the "_general_ci" version if possible.

    NOTE: The "ci" means "case-insensitive", and if you use "cs" instead then your searches won't work.


    Any good hosting company already has that set as the server default so that the user just supplies a database name and goes from there.
    Last edited by DrByte; 16 Jun 2012 at 08:25 PM. Reason: added unicode note ... see s_mack's post below
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: EXACT collation please?

    Thanks.

    However, I was just reading a few articles and postings while I waited for your answer... Several people say that you should use unicode and not general. General is fast but inaccurate and unicode isn't perceivably slower anyway. The suggestion in general being: if you support foreign charsets, you should actually support them correctly.

    Any harm in using it?

    If so... just a thought that maybe you guys should look at it for a future revision. I'll leave it with you.

    - Steven

  4. #4
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: EXACT collation please?

    just a p.s. it look like my host default is utf8_unicode_ci but I have a choice of dozens.

  5. #5
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: EXACT collation please?

    Quote Originally Posted by DrByte View Post
    when CREATING A *NEW* DATABASE is utf8_general_ci
    Can I ask, why did you stress that point so strongly??

    I am working on a fresh copy with a new DB, but if I were upgrading from one that was using Latin, what's the difference?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: EXACT collation please?

    Quote Originally Posted by s_mack View Post
    Several people say that you should use unicode and not general. General is fast but inaccurate and unicode isn't perceivably slower anyway. The suggestion in general being: if you support foreign charsets, you should actually support them correctly.

    Any harm in using it?
    Good point. Probably one worth following.

    Haven't had any negative run-ins with using general vs unicode myself, so can't comment from experience. But I suspect the advice you're reading about using unicode instead of general for utf8 is correct. Use it.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: EXACT collation please?

    Quote Originally Posted by s_mack View Post
    Quote Originally Posted by DrByte View Post
    when CREATING A *NEW* DATABASE is utf8_general_ci
    Can I ask, why did you stress that point so strongly??

    I am working on a fresh copy with a new DB, but if I were upgrading from one that was using Latin, what's the difference?
    Because upgrading is a whole different kettle of fish. And way beyond the topic of this discussion thread.
    You can't just change the characterset or collation on a database and have it change everything IN the database.
    It's not a simple "flip the switch".

    Hence: http://www.zen-cart.com/content.php?...8859-1-to-utf8
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: EXACT collation please?

    Thanks!

 

 

Similar Threads

  1. mixed sql collation
    By plc613 in forum General Questions
    Replies: 4
    Last Post: 24 Apr 2014, 02:26 PM
  2. utf8_general_ci or utf8_unicode_ci collation?
    By cphilips in forum Upgrading to 1.5.x
    Replies: 3
    Last Post: 22 Nov 2013, 06:44 AM
  3. Database Collation
    By Ninja Scott in forum Upgrading to 1.5.x
    Replies: 0
    Last Post: 4 Jan 2012, 08:09 PM
  4. Collation question
    By r189 in forum General Questions
    Replies: 3
    Last Post: 9 Aug 2010, 05:28 AM
  5. collation
    By rxalex in forum General Questions
    Replies: 3
    Last Post: 29 Jun 2010, 09:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR