0

I have letters with macrons such as ū, which I would like to store in a MySQL MyISAM table. The table is set to UTF-8 with utf8_swedish_ci collation. However, no matter what I do, the character is replaced by a question mark.

Here's what I've tried so far:

  • Used Sequel Pro to edit the row in which one of the fields contains the macron, and to enter the query manually. (Result: '?')
  • Changed collation to unicode, general, and bin, respectively. (Result: either '?' or that the row can't even be saved.)
  • Used the terminal (OS X, bash, set to UTF-8) to enter the query manually. (Result: '?')
  • Tried using PHP, since the table is going to be part by a web app. PHP recognizes the character just fine if, for instance, I save the script in UTF-8 encoding and use regular expressions on it - but it still can't save it to the table. (Result: '?')

I could save it as ū instead, but I'd rather not if possible. Any help greatly appreciated. :)

Krish R
  • 22,583
  • 7
  • 50
  • 59
Joel Hinz
  • 24,719
  • 6
  • 62
  • 75
  • 1
    If you have utf-8 allt he way, it should just work. However, there are a few things to look at carefully: is the query you are _storing_ the value with written in utf-8? Is the _column_ utf-8 (which could be other then the tables default)? Are you setting your _connection_ character set tu utf-8? [see also this answer](http://stackoverflow.com/a/279279/358679) – Wrikken Nov 10 '13 at 09:39
  • .. and also, are you actually inserting UTF-8, or has the character accidentally been regressed to a question mark in an earlier stage? – GolezTrol Nov 10 '13 at 09:47
  • Thanks for the answers. I didn't realise columns could be in other charsets as well - everything else was UTF-8 all the way down. Wrikken, if you'd like to change your comment into an answer, I would be happy to accept it. – Joel Hinz Nov 10 '13 at 09:56

0 Answers0