Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36
  1. #1
    Join Date
    Nov 2009
    Posts
    12
    Plugin Contributions
    0

    help question ability to define DB_CHARSET in v1.3.9?

    hello all
    i see in the new version that :
    Code:
    Added ability to define DB_CHARSET to automatically trigger a mysql SET NAMES statement if needed for things like UTF8 support, preventing the need to edit the db class
    so where should i define this???

  2. #2
    Join Date
    Jan 2004
    Posts
    60,160
    Blog Entries
    4
    Plugin Contributions
    49

    Default Re: ability to define DB_CHARSET ?

    Create a new file for it:

    /includes/extra_configures/my_db_charset.php
    Code:
    <?php define('DB_CHARSET', 'your_charset_here');
    Do the same with: /admin/includes/extra_configures/my_db_charset.php


    NOTES:
    - This is only applicable to v1.3.9x. It will NOT work in older versions, and is not applicable to the future versions after v1.5.0 since they will be utf8 already.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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
    Nov 2006
    Posts
    515
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    I had to add this line of code when I upgraded to php 5 [ZenCart 138 code doesn't set the encoding of the client connection, so when connecting to a MySQL 5 server, the server will return utf-8 encoded text.]
    PHP Code:
    the code added to includes/classes/db/mysql/query_factory.php line 36:

        
    mysql_set_charset('latin1'); 
    Should I keep this or go with the new code
    PHP Code:
    /includes/extra_configures/my_db_charset.php <?php define('DB_CHARSET''your_charset_here');
    I plan to upgrade this week to 1.39a
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

  4. #4
    Join Date
    Jan 2004
    Posts
    60,160
    Blog Entries
    4
    Plugin Contributions
    49

    Default Re: ability to define DB_CHARSET ?

    Using the DB_CHARSET define replaces the need for editing query_factory.php, so you should remove your custom code from that file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.



  5. #5
    Join Date
    Nov 2006
    Posts
    515
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    thanks dr byte!
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

  6. #6
    Join Date
    Nov 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    thank you

  7. #7
    Join Date
    Nov 2006
    Posts
    296
    Plugin Contributions
    2

    Default Re: ability to define DB_CHARSET ?

    hello, can you please help me out, no matter what i try i keep running into error during install:
    Code:
     1366 Incorrect string value: '\xA3:&eur...' for column 'configuration_value' at row 1
    in:
    [INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Convert currencies for Text emails', 'CURRENCIES_TRANSLATIONS', ',:,', 'What currency conversions do you need for Text emails?
    Default = &pound;,:&euro;,', 12, 120, NULL, '2003-11-21 00:00:00', NULL, 'zen_cfg_textarea_small(');]
    i have created my_db_charset.php in /includes/extra_configures & in /admin/includes/extra_configures with the line:
    Code:
    <?php define('DB_CHARSET', 'utf8');
    to no avail...

    The server specs:
    <LI id=li_server_version>Server version: 5.1.44-community<LI id=li_mysql_proto>Protocol version: 10
    <LI id=li_select_mysql_charset>MySQL charset: UTF-8 Unicode (utf8)
    <LI id=li_web_server_software>Apache/2.2.15 (Win32) PHP/5.3.2<LI id=li_mysql_client_version>MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 294543 $<LI id=li_used_php_extension>PHP extension: mysql
    The collation (not sure if it is related) is set to utf8_general_ci

    This is a clean install on a new server and the default setting seems to be this utf8 setting. I am not the admin of this server and it isn't obvious to me where or how i could chang the character set to latin on the database itself.
    The database is allready created for me, i can fill it with tables or drop the tables in it, but not alter the database itself.

    Any input to resolve would be highly appreciated, thank you

  8. #8
    Join Date
    Jan 2004
    Posts
    60,160
    Blog Entries
    4
    Plugin Contributions
    49

    Default Re: ability to define DB_CHARSET ?

    Add it to the bottom of /zc_install/includes/installer_params.php ... and keep it in the other locations where you already have it, too.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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
    Nov 2006
    Posts
    296
    Plugin Contributions
    2

    Default Re: ability to define DB_CHARSET ?

    Thank you for the input.
    I added the line like so after the last line in that file:
    Code:
    define('STRICT_ERROR_REPORTING', false);
    define('DB_CHARSET', 'utf8');
    unfortunately, it results in the exact same error message.

    anything else i can try to resolve?

  10. #10
    Join Date
    Jan 2004
    Posts
    60,160
    Blog Entries
    4
    Plugin Contributions
    49

    Default Re: ability to define DB_CHARSET ?

    You need to say 'latin1' instead of 'utf8'
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.



 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Uploading Ability?
    By wildkeith in forum General Questions
    Replies: 2
    Last Post: 22 Nov 2008, 04:59 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
  •