- Timestamp:
- Jan 15, 2010, 6:59:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/include/xpress_block_render.php
r497 r502 22 22 function xpress_block_cache_read($mydirname,$block_name) 23 23 { 24 $xml_name = $block_name . '.xml'; 25 $xml_data = xpress_cache_read($mydirname,$xml_name); 26 27 $GLOBALS['DO_LIBXML_PATCH'] = get_xpress_mod_config($mydirname,'libxml_patch'); 28 24 $xml_name = $block_name . '.xml'; 25 $xml_data = xpress_cache_read($mydirname,$xml_name); 26 27 $GLOBALS['DO_LIBXML_PATCH'] = get_xpress_mod_config($mydirname,'libxml_patch'); 28 29 // The character-code not treatable exists when 'XML_unserialize' of PHP5 processes EUC-JP. 30 // And, the result is returned by character-code UTF-8. 31 // Measures 32 // After the character-code is converted into UTF-8, XML_unserialize will be processed. 33 if ( strstr($xml_data, '<?xml version="1.0" encoding="EUC-JP" ?>') !== false 34 && version_compare(PHP_VERSION, '5.0.0', '>') ) 35 { 36 $xml_data = str_replace('<?xml version="1.0" encoding="EUC-JP" ?>', '<?xml version="1.0" encoding="UTF-8" ?>', $xml_data); 37 $ans = mb_convert_variables('UTF-8' , 'EUC-JP', &$xml_data); //EUC-JP to UTF-8 29 38 $ret = @xpress_XML_unserialize($xml_data); 30 if (strstr($xml_data, '<?xml version="1.0" encoding="EUC-JP" ?>') !== false){ 31 if (version_compare(PHP_VERSION, '5.0.0', '>')) { 32 $ans = mb_convert_variables('EUC-JP' , 'UTF-8', &$ret); //xpress_XML_unserialize() Return UTF-8 at PHP5 33 } 34 } 35 return $ret; 39 $ans = mb_convert_variables('EUC-JP' , 'UTF-8', &$ret); //UTF-8 to EUC-JP 40 } else { 41 $ret = xpress_XML_unserialize($xml_data); 42 } 43 return $ret; 36 44 } 37 45
Note: See TracChangeset
for help on using the changeset viewer.