Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,373
    Plugin Contributions
    94

    Default Fresh install of v1.5.0, database CHARSET anomoly ...

    Performed a fresh install of v1.5.0 on my XAMPP setup of my Windows 7 computer using a newly created a database using latin1_general_ci as my collation. On the database screen of the install, I indicated that I would be using Latin1 as my character set.

    Upon completion of the installation, my /includes/languages/english.php indicates that I'm using utf-8 as my charset and my database tables are all using utf8_general_ci as their collation.

    What else did I need to do to get a Latin1 instead of UTF-8 configuration?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    I believe that with v1.50 - - utf-8 is the default
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    Zen Cart doesn't edit your language files for you. If you want to specifically use iso-8859-1, you'll need to set that in your language files by hand.
    .

    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.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,373
    Plugin Contributions
    94

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    Quote Originally Posted by DrByte View Post
    Zen Cart doesn't edit your language files for you. If you want to specifically use iso-8859-1, you'll need to set that in your language files by hand.
    OK, but how do you explain that all the tables in my database (for which I specified a latin1_general_ci collation when it was created) are using utf8_general_ci even though I specified the "Latin1" charset via the dropdown box during the installation?

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,373
    Plugin Contributions
    94

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    This was bugging the heck out of me and I finally tracked it down. No matter what you do, if you perform a fresh install of v1.5.0 into an empty database created using latin1_general_ci collation and select "Latin1" as the database collation type the resulting database uses only utf8_general_ci collation.

    The problem is in the file /zc_install/includes/installer_params.php:
    Code:
    <?php
    /**
     * @package Installer
     * @access private
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: installer_params.php 18819 2011-05-31 20:25:53Z drbyte $
     */
    
    /**
     * Runtime Parameters used by browser interface
     */
    //  $session_save_path = (@ini_get('session.save_path') && is_writable(ini_get('session.save_path')) ) ? ini_get('session.save_path') : realpath('../cache');
      $session_save_path = (is_writable(realpath('../cache')) ) ? realpath('../cache') : ini_get('session.save_path');
      define('SESSION_WRITE_DIRECTORY', $session_save_path);
      define('DEBUG_LOG_FOLDER', realpath('../cache'));
    
      // Set the following to TRUE if having problems (blank pages, etc). Best to leave at FALSE for normal use.
      define('STRICT_ERROR_REPORTING', FALSE);
    
    
      // optionally set this to 'latin1':
      define('DB_CHARSET', 'utf8');
    
      // optionally uncomment the following line if choosing 'utf8' or 'latin1' above are causing problems:
      // define('IGNORE_DB_CHARSET', TRUE);
    The DB_CHARSET define is used by the CREATE_TABLE clause of the select statement of the executeSQL function within /zc_install/includes/functions/general.php and is set (if not already defined) by the dbActivate function within /zc_install/includes/classes/installer.php to reflect the value specified by the drop-down box within the Database Configuration step of the install.

    The problem is that DB_CHARSET is already defined during the inclusion of the installer_parms.php file ... the net result being that a fresh install of v1.5.0 ALWAYS uses a utf8_general_ci collation regardless of the value chosen by the user during the install.

    The fix is to simply comment out the define statement in the installer_parms.php file:
    Code:
    <?php
    /**
     * @package Installer
     * @access private
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: installer_params.php 18819 2011-05-31 20:25:53Z drbyte $
     */
    
    /**
     * Runtime Parameters used by browser interface
     */
    //  $session_save_path = (@ini_get('session.save_path') && is_writable(ini_get('session.save_path')) ) ? ini_get('session.save_path') : realpath('../cache');
      $session_save_path = (is_writable(realpath('../cache')) ) ? realpath('../cache') : ini_get('session.save_path');
      define('SESSION_WRITE_DIRECTORY', $session_save_path);
      define('DEBUG_LOG_FOLDER', realpath('../cache'));
    
      // Set the following to TRUE if having problems (blank pages, etc). Best to leave at FALSE for normal use.
      define('STRICT_ERROR_REPORTING', FALSE);
    
    
      // optionally set this to 'latin1':
    //  define('DB_CHARSET', 'utf8');
    
      // optionally uncomment the following line if choosing 'utf8' or 'latin1' above are causing problems:
      // define('IGNORE_DB_CHARSET', TRUE);

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,763
    Plugin Contributions
    30

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    just for interest, why did you prefer latin-1 over utf-8 for a new install?
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,373
    Plugin Contributions
    94

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    I've got (mostly) English-only websites and I use a US-English keyboard. Why should I "take the plunge" into utf-8? It seems like most of the "funky character display" and admin white-page due to html-special-character problems that I've seen posted within this forum are based on utf8 anomalies rather than latin1.

    In other words, I've not seen a compelling reason to go the utf-8 route. If you have one, let me know as I appreciate and listen to contrary opinions.

    My reason for this post is that the Latin1 side of the install just plain doesn't work ... the english.php files are hard-coded utf8 and the the database install forces utf8_general_ci collation (even though you've chosen Latin1).

  8. #8
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    Quote Originally Posted by lat9 View Post
    It seems like most of the "funky character display" and admin white-page due to html-special-character problems that I've seen posted within this forum are based on utf8 anomalies rather than latin1.
    Clarification: Those problems are a result of a MISMATCH of character-set settings.
    .

    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.

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,373
    Plugin Contributions
    94

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    Quote Originally Posted by DrByte View Post
    Clarification: Those problems are a result of a MISMATCH of character-set settings.
    Some of which have unfortunately been the result of a standard installation, if anyone chose (as I did) the Latin1 selection for database collation. The result in that case is that the database winds up being utf8_general_ci, the configuration.php files specify latin1 and the english.php files specify utf-8.

    For an English-only storefront, what's the business-related decision to go the utf8 route rather than latin1?

  10. #10
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,763
    Plugin Contributions
    30

    Default Re: Fresh install of v1.5.0, database CHARSET anomoly ...

    Getting very off-topic here...

    problems.....are based on utf8 anomalies rather than latin1.
    Yes. But as I usually stick my nose into those threads (as I had problems in the early days that took me a lot of time to understand) I think I am fairly safe in saying they are ALL due to people going 8859 to utf8 and not doing it 100%/not understanding the chain of data-passing events.

    I don't think there is a problem with a new 1.5 install in utf-8.

    I assume the decision to go utf-8 as the default install was taken to reduce these conversions/problems surfacing at a later date when people start selling outside their initial territory.

    Nonetheless if the latin.1 option is offered at install it should work, which you have proved it doesn't.

    For an English-only storefront, what's the business-related decision to go the utf8 route rather than latin1?
    None on the face of it, but maybe there will be problems with customers names and addresses using accents.

    The whole charset issue is a real Pandoras Box, the best explanation I've seen is this one:
    http://coding.smashingmagazine.com/2...haracter-sets/

    but in the lack of any real "standard" at all, I think utf-8 is as close as it gets and should be the default setting for any software that sets itself up to be used internationally.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Cannot Connect to Database on Fresh 1.5.4 Install
    By numinix in forum Bug Reports
    Replies: 1
    Last Post: 26 Jan 2015, 05:22 PM
  2. Input Anomoly in fresh install
    By mroland in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 10 Nov 2007, 01:22 PM

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