0

I have created a small contact form creator in PHP and everything works fine for me, but my friend in Denmark says the forms don't display danish characters properly and won't submit when Danish characters are used. I have never worked with internationalization and the PHP manual doesn't help me at all.

How can I make my PHP applications be compatible with other language characters. I work with PHP 5.3.x and my files are created with utf-8 without bom and everything in my pages and database are utf-8. Is there an article you can recommend that a beginner can understand?

Thank you!

user1108996
  • 275
  • 2
  • 4
  • 13

2 Answers2

1

1.Add meta charset on your page

2.Serve Content-Type:text/html; charset=utf-8 in header

3.Use set names for mysql, see SET NAMES utf8 in MySQL?

Community
  • 1
  • 1
Artjom Kurapov
  • 6,115
  • 4
  • 32
  • 42
0

Seems you have everything that needs to be, but clearly there's some little thing probably one of the things that you think that is in place.

Whatever, as a last resort, you can use php's htmlspecialchars() function to encode all chars into html entities.

Ata S.
  • 890
  • 7
  • 12