php - Native Encode Support -
a simple , stupid question im wondering.
i saw in php manul php supports 256-character set. not specified if ascii code.
from php manual found this page confuse me more.
i wanna know if depends of operating system.
native support php ascii code? 1 document stipulate it?
what this encode supports?
php uses asci characters each of byte containing 8 bit. that's all.
php doesn't care interpretation of each byte, reads source or writes sink.
to specific code-page these bytes belong doesn't matter. php doesn't care it.
if php-script interacts web-server, each page should contain hint, defines correct interpreation in <head>
of <html>
page:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
the above declaration defines, characters of html-page should interpreted iso latin-1 codes. additionally, if page sends characters php-script, browser sends them iso latin-1 encoded ascii characters.
if forget define content-type, it's browser use code page / text encoding.
that said, free use ascii text-encoding best fits needs. never forget set content-type in web-page.
extensions iconv out, in case need process e.g. utf-8 characters.
Comments
Post a Comment