/* ----CHARSET Settings---- The settings below are used for various operations that are charset sensitive, for instance cleaning "user input". The settings with # in front will need to be un-commented (remove the #) to use. For "input cleaning", and anywhere else the PHP function htmlspecialchars() would normally be used, there is a 3 step process (below) to ensure that the data is not corrupted due to differences in charsets. Note that step 1 and 3 are skipped if the appropriate settings are not specified (Most sites will only need to set CHARSET_CLEAN, step 2): 1. (Optional step, only run if CHARSET_FROM is set): The input's charset is converted from the CHARSET_FROM setting to the CHARSET_CLEAN setting. It is converted either using mb_convert_string() or iconv(), according to CLEAN_METHOD setting. See http://www.php.net/mb_convert_encoding for more information on setting CLEAN_METHOD to mb_convert_encoding. CHARSET_FROM is used as the 3rd var passed to that function. If CLEAN_METHOD is not set, and the function exists, mb_convert_encoding is the default method used to convert the charset. See http://www.php.net/iconv for more information on setting CLEAN_METHOD to iconv. CHARSET_FROM is used as the 1st var passed to that function. This step, and optionally step 3, are necessary in order to be able to clean any charset that is not compatible with the function htmlspecialchars() (see step 2) 2. (Always run): The input is "cleaned" using the PHP function htmlspecialchars() This step will use the CHARSET_CLEAN setting for the charset, that charset must be compatible with htmlspecialchars(). This step is always run for security reasons, to prevent a certain type of hacking called "Cross Site Scripting" or XSS attack. If the charset is not specified, or is not a compatible charset, the default of ISO-8859-1 is used. See http://www.php.net/htmlspecialchars for a list of compatible charsets you can use. 3. (Optional step, only run if CHARSET_TO is set): The cleaned input's charset is converted from the CHARSET_CLEAN setting to the CHARSET_TO setting. It is converted either using mb_convert_string() or iconv(), according to CLEAN_METHOD setting. See http://www.php.net/mb_convert_encoding for more information on setting CLEAN_METHOD to mb_convert_encoding. CHARSET_TO is used as the 2nd var passed to that function, at this step. If CLEAN_METHOD is not set, and the function exists, mb_convert_encoding is the default method used to convert the charset. See http://www.php.net/iconv for more information on setting CLEAN_METHOD to iconv. CHARSET_TO is used as the 2nd var passed to that function during this step. */ define('CHARSET_CLEAN', 'UTF-8'); //Required, see notes above (step 2) #define('CHARSET_FROM', 'UTF-8'); //optional, un-comment and modify 'UTF-8' as needed //to use. See notes above (step 1) #define('CHARSET_TO','UTF-8'); //optional, un-comment and modify 'UTF-8' as needed //to use. See notes above (step 3) #define('CLEAN_METHOD', 'mb_convert_string'); //optional, un-comment to use mb_convert_string() //in steps 1 and 3 above, or un-comment and change //the 'mb_convert_string' to 'iconv' to use iconv() //instead. Valid settings are 'mb_convert_string' //and 'iconv'. See notes above (steps 1 and 3)