PDA

View Full Version : phpinfo? which to use for charset or encoding?


student101
09-23-2008, 06:53 AM
When I add this to a .php page and call it on my PC;<?php
phpinfo(); ?>I get these:
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1
SQLite Encoding iso8859
For charset I get this;
default_charset no value no value
Would this then mean that it would be safer for me to create my pages like this;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
OR
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

lux
09-23-2008, 11:52 AM
the doctype is not related to the settings you've listed.

"Doctype is a special declaration at the very top of your webpage source, right above the <HTML> tag, that informs validators the rules in which to validate your page using, and for modern browsers (IE6+, Firefox, NS6+, Opera, IE5 Mac), whether to display your page in Quirks or Standards mode."

and you should choose a charset based on the expected characters that you will be displaying.

student101
09-23-2008, 11:55 AM
I use "utf-8" should I be using "iso-8859-1" ? since my setup shows iso-8859-1

lux
09-23-2008, 12:13 PM
they're not related

use uft-8 if you are worried that you might use characters that fall outside the range offered by iso-8859-1

student101
09-25-2008, 09:43 AM
Thanks.


.