Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Nov 2008
    Posts
    15
    Plugin Contributions
    0

    Default Strange encoding problem

    I've been using zencart for some years, now I'd like to setup new shop which should be non-english.
    I've made copy of files and installed it in new database.
    While adding categories/products I got question marks instead of national letters.
    Easy thing - db is probably latin1 and it was - I've converted it to utf-8.
    Now I can add and see national letters in admin, but still get junk in public store.

    Charset is also set to utf8. Any ideas?

    You can check it out on: http://kreatywne.wrota.net/sklep/
    Code:
    $ grep -r define.*CHARSET -r .|less
    ./includes/dist-configure.php:define('DB_CHARSET', 'utf8');
    ./includes/classes/db/mysql/query_factory.php:    if (defined('DB_CHARSET')) $dbCharset = DB_CHARSET;
    ./includes/configure.php:  define('DB_CHARSET', 'utf8');
    ./includes/functions/functions_email.php:      $mail->CharSet =  (defined('CHARSET')) ? CHARSET : "iso-8859-1";
    ./includes/languages/english.php:  define('CHARSET', 'utf-8');
    ....

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

    Default Re: Strange encoding problem

    /includes/languages/english.php: define('CHARSET', 'utf-8');
    What language is this???
    Do you have a folder and english.php file re-named to that language loaded?

    https://www.zen-cart.com/content.php...-are-they-used
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Nov 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Strange encoding problem

    For now I'm using english.php language.
    First of all I'm trying to get database charset working.
    You can see the problem when you look at categories, last one should say RÓŻNOŚCI: http://kreatywne.wrota.net/sklep/index.php
    Last edited by daniellek; 9 Feb 2016 at 10:46 PM.

  4. #4
    Join Date
    Nov 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Strange encoding problem

    Here's how it looks in admin: Name:  zen.jpg
Views: 98
Size:  14.4 KB

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Strange encoding problem

    Use phpmyadmin to determine what collation your DB is and what collation your tables are
    They should both/all be utf-8
    Zen-Venom Get Bitten

  6. #6
    Join Date
    Nov 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Strange encoding problem

    Quote Originally Posted by kobra View Post
    Use phpmyadmin to determine what collation your DB is and what collation your tables are
    They should both/all be utf-8
    I converted DB and all the tables to utf-8, example from categories:
    Code:
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    
    --
    -- Baza danych: `kreatywne_sklep`
    --
    
    -- --------------------------------------------------------
    
    --
    -- Struktura tabeli dla tabeli `categories_description`
    --
    
    CREATE TABLE IF NOT EXISTS `categories_description` (
      `categories_id` int(11) NOT NULL DEFAULT '0',
      `language_id` int(11) NOT NULL DEFAULT '1',
      `categories_name` varchar(32) NOT NULL DEFAULT '',
      `categories_description` mediumtext NOT NULL,
      PRIMARY KEY (`categories_id`,`language_id`),
      KEY `idx_categories_name_zen` (`categories_name`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    --
    -- Zrzut danych tabeli `categories_description`
    --
    
    INSERT INTO `categories_description` (`categories_id`, `language_id`, `categories_name`, `categories_description`) VALUES
    (16, 1, 'Różności', '');
    
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Strange encoding problem

    What do you see in phpmyadmin for collation
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: Strange encoding problem

    Look in your primary language files, assuming at this point that you're using english.php for both the admin and store-front. I think that the issue is the PHP locales that are being used.

    In the as-shipped Zen Cart /includes/languages/english.php file, that setting looks like
    Code:
    // look in your $PATH_LOCALE/locale directory for available locales..
      $locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
      @setlocale(LC_TIME, $locales);
    If you haven't changed those settings for your language, that's most likely the source of your issue. Since the information displays properly in the admin, see what the similar settings are for the /YOUR_ADMIN/includes/languages/english.php file and use those values for the store.

  9. #9
    Join Date
    Nov 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Strange encoding problem

    Quote Originally Posted by kobra View Post
    What do you see in phpmyadmin for collation
    utf8_general_ci

  10. #10
    Join Date
    Nov 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Strange encoding problem

    Quote Originally Posted by lat9 View Post
    Look in your primary language files, assuming at this point that you're using english.php for both the admin and store-front. I think that the issue is the PHP locales that are being used.
    It's en_US.utf8. I've tried changing it to pl_PL.utf8 - but it didn't change anything (utf8 is the same in english and polish ;-)
    Code:
    includes/languages/english.php:// look in your $PATH_LOCALE/locale directory for available locales..
    includes/languages/english.php:  $locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
    includes/languages/english.php:  @setlocale(LC_TIME, $locales);
    
    xxx/includes/languages/english.php:// look in your $PATH_LOCALE/locale directory for available locales..
    xxx/includes/languages/english.php:$locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
    xxx/includes/languages/english.php:@setlocale(LC_TIME, $locales);

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Small encoding problem with French accents
    By gotyed in forum General Questions
    Replies: 17
    Last Post: 23 Oct 2016, 03:00 PM
  2. templates content encoding problem
    By Hector Gutierrez in forum General Questions
    Replies: 0
    Last Post: 25 Jul 2013, 10:34 PM
  3. Encoding problem
    By wilsonshen in forum General Questions
    Replies: 4
    Last Post: 12 Mar 2011, 03:16 AM
  4. Encoding Problem !!
    By Processor in forum Addon Language Packs
    Replies: 4
    Last Post: 21 Aug 2010, 03:50 AM
  5. EasyPopulate encoding problem
    By balihr in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 29 Oct 2008, 10:10 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