SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast SteveMif's Avatar
    Join Date
    Aug 2013
    Location
    Malta
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Character encoding problems with MySQL (even local)

    CharacterImage.jpg

    It is for my attempts that I am trying to solve a problem about diacritics (special characters) to be displayed on a webpage directly from a MySql database. The character are Ma ltese ĊĠĦŻ ċġħż

    My webpage charset is utf-8, while the MySql table I tried to assign it different randome charset without success. I am trying to understand what is going on to, but nothing appear logical.

    So I enter data in MySql from an XL .csv through a convertor script I coded. When I save the csv file, the diacritics go to ? sign (I read there is some kind of XL bug?!?) Anyway, so I bypassed this (for trialling) by physically editting the characters through MySql Browser. The characters seem to store well in the db. Then when such strings are fetched to be displaed on a webpage, I get again the ? sign.

    In the image attached, yo ucan see that the webpage is set to utf (right side); the MySql db has strings with 'ħ' but the resulting webpage of that string is with a ? instead.

    I want to solve this step by step, so my first obstacle is why the string (ħ) in MYSql is not displayng well on the website?

    To make it more puzzling, if I type these characters in the php, they show up well - it seems the transfer from MySql to php to heml is the culprit?

    No idea what's going on, please help

  2. #2
    SitePoint Enthusiast SteveMif's Avatar
    Join Date
    Aug 2013
    Location
    Malta
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the header of a mysql dump for the aforementioned table:
    Code MySQL:
    -- MySQL Administrator dump 1.4
    --
    -- ------------------------------------------------------
    -- Server version	5.1.47-community
     
     
    /*!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 */;
     
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


Tags for this Thread

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
  •