Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    53
    Plugin Contributions
    0

    red flag Yesterday everything was all right. Today I have Encoding problem

    I guess i am the first one getting this thorny problem.
    My website went very well until today. All the non-English language becomes wired code, unreadable (like: ?ubo� Kov�?).
    Yesterday everything was all right. Today I checked all the encoding setting including in the code and DB. They are still the same, utf8.
    Yesterday i did nothing but Empty the activity log file. Every 2 months zen cart automatically advise me to empty it. I don't think this will cause any problem because i did so many times.
    What is the possible reason?
    I will be greatly grateful if anyone could offer some help.
    Thanks

  2. #2
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Encoding problem

    If you have made no changes Talk to your Host and ask what updates they may have carried out on the server.

    also what version of zncart are you using, have you checked the error log on your site especially zencarts /cache folder
    Webzings Design
    Semi retired from Web Design

  3. #3
    Join Date
    Apr 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Encoding problem

    I checked the /cache/ folder. But there is only records of last year. It seems the function doesn't work on my website now.

  4. #4
    Join Date
    Apr 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Encoding problem

    I use ZC1.39h

  5. #5
    Join Date
    Apr 2010
    Posts
    53
    Plugin Contributions
    0

    Default Very strange and interesting Encoding Problem

    Yesterday I posted my problem here but got no solution.
    I spent all day to study this problem.
    My ZC1.39h store suffered encoding problem 2 days before. Non-English language can not be displayed correctly. That morning l logged in to my admin and got an error of DB connection (I didn't save the error information, which i regret so much now). Then i refreshed the page. The error is gone and the log in page display. Then i logged in and found this problem.
    My ZC store' charset is utf8. I changed following this page: https://www.numinix.com/blog/2011/08...-3-9-to-utf-8/ It had been working very well for a long time until this problem occur. I checked all the setting following the article above, and everything is the same.
    I contacted my server support and checked if the did any updating. They replied that they did nothing on updating but just some unscheduled maintenance work. They confirmed that the php and DB charset is all utf8 by default. I guess i can not get more information from them.
    To make sure if the problem is caused by the server problem, i installed now ZC1.50 in my server space and found everything is all right. Now i think it was my store problem.
    Last night i found that the encoding problem only exists in ADMIN area. To make further research, i wrote a php file with the following code:
    PHP Code:
    require('includes/application_top.php');
    header('Content-Type:text/html;charset=utf-8');
    function 
    query($orderID) {
    global 
    $db;
    $orders_processing $db->Execute("select delivery_name from ".TABLE_ORDERS" where ( orders_id =".(int)$orderID.")");
    print_r($orders_processing->fields);
    }
    query(10464501); 
    I put this file under /MY_STORE/ and run it. Result:
    Array ( [delivery_name] => KOGUT Stéphane )
    I put this file under /MY_STORE/ADMIN/ and run it (after log in). Result:
    Array ( [delivery_name] =>KOGUT St�phane )

    I searched 'charset' at my admin and got (i list part of it which i think might be helpful):
    Code:
    /includes/classes/class.phpmailer.php
    Line #40 : * Sets the CharSet of the message. 
    Line #43 : var $CharSet = "utf8"; 
    
    /includes/extra_configures/my_db_charset.php
    Line #0 : <?php define('DB_CHARSET', 'utf8');
    
    /includes/functions/functions_general.php
    Line #1518 : function charsetConvertWinToUtf8($string) { 
    Line #1525 : * Convert supplied string to/from entities between charsets, to sanitize data from payment gateway 
    Line #1529 : function charsetClean($string) { 
    Line #1530 : if (CHARSET == 'UTF-8') return $string; 
    Line #1531 : if (function_exists('iconv')) $string = iconv("Windows-1252", CHARSET . "//IGNORE", $string); 
    Line #1533 : $string = html_entity_decode($string, ENT_QUOTES, CHARSET); 
    
    /elechouse/includes/languages/english.php
    Line #47 : // charset for web pages and emails 
    Line #48 : define('CHARSET', 'utf8'); 
    
    /includes/languages/MY_TEMPLATE/english.php
    Line #41 : // charset for web pages and emails 
    Line #42 : define('CHARSET', 'utf8'); 
    
    /ADMIN/includes/extra_configures/my_db_charset.php
    Line #0 : <?php define('DB_CHARSET', 'utf-8');
    
    /ADMIN/includes/languages/english.php
    Line #64 : // charset for web pages and emails 
    Line #65 : define('CHARSET', 'utf8');
    I really don't know what to do next to find out solution of this problem.
    I will really appreciate if anyone could help me.
    Thanks

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Very strange and interesting Encoding Problem

    The last thing I would do is change ANYTHING related to character sets ON A LIVE SITE.
    Once the site is running live, making any changes runs the risk of damaging or losing data in extended characters, similar to what you initially described. Sounds like you've been changing things.

    https://www.zen-cart.com/tutorials/i...hp?article=414
    .

    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
    Apr 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Very strange and interesting Encoding Problem

    Thanks for your fast reply.
    But that page doesn't offer helpful information.
    Do you mean i should change back to "latin" charset?

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Very strange and interesting Encoding Problem

    It's not my strongest area of expertise, but the key thing that I do know for certain is that your database content and your database collation and your php file encoding and your html output need to all use the same encoding. If you start changing them in one place, you need to change them in all places.

    THE MOST IMPORTANT thing you've said thus far is that "YESTERDAY IT WAS ALRIGHT and suddenly it changed". So, the IMPORTANT thing you need to do NOW is fix whatever you changed yesterday.
    .

    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
    Apr 2010
    Posts
    53
    Plugin Contributions
    0

    Default Re: Very strange and interesting Encoding Problem

    Thanks man
    "Yesterday" i didn't change anything about the code. That's why this problem is so strange.

 

 

Similar Threads

  1. v151 Cannot login to admin - was able to yesterday
    By mrcastle in forum General Questions
    Replies: 3
    Last Post: 14 Jan 2015, 09:42 AM
  2. I get a 404 page when i try to access my store even though it was there yesterday
    By lajill in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 17 Oct 2007, 01:18 AM
  3. Store was fine yesterday and now errors!
    By mommydesigns in forum General Questions
    Replies: 1
    Last Post: 16 Oct 2006, 09:34 PM

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