A.N.M. Saiful Islam
A.N.M. Saiful Islam

Reputation: 2138

Using Unicode with PHP

How do I use Unicode with PHP?

I want to store Unicode value in a PHP variable but it output some question marks.

What is the solution?

Upvotes: 4

Views: 5182

Answers (3)

Eric Butera
Eric Butera

Reputation: 638

This is something you're going to have to read up on to do correctly, but here are two links you should start with: Character Sets / Character Encoding Issues Handling UTF-8 with PHP

Upvotes: 3

gimpe
gimpe

Reputation: 1057

In php.ini:

default_charset = "UTF-8"
mbstring.internal_encoding = "UTF-8"

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
mbstring.func_overload = 4

Upvotes: 8

user187291
user187291

Reputation: 53940

make sure your output encoding is utf8

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

PS accept some answers.

Upvotes: 4

Related Questions