The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

issue displaying characters

Discussion in 'Database Discussions' started by keat63, Dec 22, 2014.

  1. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I'n in the process of migrating a web site from a Direct Admin hosted site to a WHM Server.
    I've copied the database across, but for some reason I can't seem to get any line which contains ² to dsiplay.

    For instance. In the database I can see my table which contains a product description: Cord End 0.25mm²
    But the whole line isn't displayed when viewing through a browser.
    If i remove the ², then the product description can be seen.

    The odd thing is, it works on the hosted site.

    I'm happy to provide more info, if anyone can give me a clue where to start even looking.

    if it helps, then the none working site is: PHP Version: 5.4.35 MYsql Version: 5.5.40-cll
    the working site is PHP Version 5.2.9 MySQL Version: 5.0.67-community
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Re: issue dispalying charachters

    Hello :)

    Do you have any custom configuration values in /etc/my.cnf on the Direct Admin server? Are you using our complimentary migration service so that our migration specialists can assist you throughout the process?

    Thank you.
     
  3. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Re: issue dispalying charachters

    I don't have access to the etc folder on the DA hosted site, however, i sent a support ticket asking for that particular file.

    I wasn't aware of a complimentary migration service, if you could point me in the right direction to ask a few questions that i would appreciate this.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Re: issue dispalying charachters

    We actually require that you have root access to the source server to qualify for the complimentary migration server, so based on your previous response that's not the case here. However, we're still happy to assist you with any questions you may have throughout the process. Let us know the response from your provider.

    Thank you.
     
  5. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Re: issue dispalying charachters

    To be perfectly honest, most of the migration (short of changing the nameservers) is done.
    If i could figure out why this ² doesn't work, i think i'm ready to switch over.
     
  6. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Re: issue dispalying charachters

    I had a reply back from the host.
    As this is a server wide file, they are reluctant to share this with me, but have asked if there's anything in particular that I need from the file.

    Any suggestions what i need to ask for.
     
  7. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Re: issue dispalying charachters

    I got an answer back.


    the only thing included in this file is:

    [mysqld]
    local-infile=0
     
  8. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Considering the table displays correctly on the old site, and if i perform a query in PHPAdmin I can also see the data in both the old and the new databases, could the problem be related to Apache or PHP config instead. ?
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's possible that it's associated with the PHP and MySQL version changes, or there's a character set issue. Is this a custom application or is it a CMS that's actively developed?

    Thank you.
     
  10. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    It's an old version of cubecart which i eventually intend to upgrade, but need to get it fully functional first.
    What I don't understand is the data is there in the database, but i can't see this in any web browser.


    eg, if i leave the full string "Cord End 0.25mm²" in the table, then nothing displays in the browser.
    If i remove the little number ² , so the table entry is "Cord End 0.25mm", then "Cord End 0.25mm" displays in the browser.
    What would cause the browser, PHP or Apache to drop the whole string ?

    I did consider character sets, thinking along the lines of UTF8, but never having ever seen this before now, it's a whole new area to research.
    Having said that, I did compared the character sets between the two databases and the two schemas, making a few changes to the new database, but can't seem to overcome this.
     
    #10 keat63, Dec 23, 2014
    Last edited: Dec 23, 2014
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I'd recommend making a backup of the account and then upgrading CubeCart. It's possible the newer version will resolve this issue.

    Thank you.
     
  12. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Any ideas why the whole string would be dropped just because it contains this UTF8 character.
     
  13. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,449
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You might do better to stick with your thread over at Cubecart forums. It seems you're speaking with a "CubeCart Jedi Knight" over there. You can't go wrong with a guy that calls himself that I don't think. :)

    Old scripts on new software, as is the case here, is a problem all in itself. Add in how you're adding titles to your products, and you've got a whole other layer of issues that can go wrong, possibly causing this.

    This isn't a cPanel related issue though.
     
  14. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Before I give in with it, one last thing.

    I created the new database manually via Cpanel, created the user and privileges etc.
    Then on the old database i exported all the tables to a number of SQL exports.
    These I imported in to the new database.

    What I didn't do was dump the information schema.
    Now I can't really do anything too drastic with the new database until after christmas, but would dumping the old schema and importing this in to the new database have any effect ?
     
  15. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    could this be related ?

    If you have content that is not 100% UTF-8 then TAKE NOTE:

    Starting in PHP 5.4 htmlspecialchars() and htmlentities() assume charset=UTF-8 by default AND WILL RETURN BLANK IF YOUR INPUT IS NOT VALID UTF-8.

    So if you have a lot of function calls that look like this:
    <?php
    echo htmlspecialchars($input);
    // or
    echo htmlentities($input);
    ?>
    i.e. no charset and no flags -- and $input is ISO-8859 (or anything else apart from 7-bit ASCII or UTF-8) -- then PHP 5.4 and 5.5 will return an empty string, and you will be surprised and probably unhappy.

    This is apparently a feature, not a bug.
     
  16. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    It does in fact seem that the issue is related to PHP5.4

    PHP: htmlspecialchars - Manual

    I downgraded to PHP 5.3.29 this morning and the special characters have returned.
     
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page