1

I'm from Hungary, and our language use the letter "ő". If I upload anything to my mysql database through php, to a latin1_swedish_ci encoded column, it ends up being weird, but after all when I fetch some datas from the database I can easily use a utf8_decode($string) to be compatable with my utf-8 meta charset.

At the contacts part of my page, there's a simple e-mail form, which sends the strings via a form to an e-mail address. Problem is, I've tried different encodings, and the best was utf8_decode($string) but it still prints out the letter "ő"(s) as question marks when I get the mail.

For example: Törtető emberiség védelmezője becomes Törtet? emberiség védelmez?je

Any ideas for a better encoding/decoding ?

Saty
  • 22,443
  • 7
  • 33
  • 51
Narc0t1CYM
  • 499
  • 6
  • 25
  • 1
    hard to say without knowing, if you set encoding of your webside correctly. all the parts in your workflow (websides meta-tag, php-file-encoding, database) have to be set to utf, then you have no problem. – Paladin Jul 14 '15 at 11:20
  • 1
    [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – Mark Baker Jul 14 '15 at 11:30

2 Answers2

1

Definitely UTF-8. We are using it all the time for our Estonian letters like öäüõ.

You probably have to set your header as well.

Like this:

header('Content-Type: text/html; charset=utf-8');

BR's

user2831723
  • 832
  • 12
  • 25
1

Found the answer. If any of my fellow hungarians or other nation's people who use a weird language would like to solve their letter problems via php use this method.

    header('Content-type: text/plain; charset=utf-8');

Paste it to the start of your code, so the encoding will be fine :)

Narc0t1CYM
  • 499
  • 6
  • 25