Jump to content
php.lv forumi

The XML page cannot be displayed


anonīms

Recommended Posts

Nav iespējams atvērt xml failu caur IE8,IE7. Caur IE9 viss ir okey. 

 

The XML page cannot be displayed  
<?xml version="1.0" encoding="WINDOWS-1257" standalone="yes" ?>
	<pieteikums>
		<datums>2013.01.29</datums>
		<laiks>15:00</laiks>
		<valoda>LV</valoda>
		<grupa>induviduals</grupa>
		<apmekletaji><apmekletajs vards="xml encoding" Darbs="xml encoding"/></apmekletaji>
		<Kontaktpersona>xml encoding</Kontaktpersona>
		<Kontaktinformacija>xml encoding / xml encoding</Kontaktinformacija>
		<Organizacija>xml encoding</Organizacija>
		<velmes>xml encoding</velmes>
	</pieteikums>
	$xml_name = 'rezervacija'.$data['rid'].'.xml';
	$xmlPath = file_create_filename($xml_name, file_build_uri(''));
	$xml = iconv("UTF-8","windows-1257//IGNORE",$xml);
	file_put_contents($xmlPath, "\xEF\xBB\xBF".  $xml);

 

Kur varētu būt problēma. Centos arī caur notepad++ ieiet pie encodinga un uzlikt failam characters > baltic > win1257, bet panākumi nekādi...

 

Kur varētu būt gļuks? 

 

Link to comment
Share on other sites

Stipri šaubos, ja domā par mb..

 

	// send mail	
	$xml_name = 'rezervacija'.$data['rid'].'.xml';
	$xmlPath = file_create_filename($xml_name, file_build_uri(''));
	dsm(mb_detect_encoding($xml));
	$xml = mb_convert_encoding($xml, 'UTF-8', "auto");
	dsm(mb_detect_encoding($xml));
	file_put_contents($xmlPath, $xml);

 

 

gan pirmais, gan otrais dsm (aka print) izvada utf-8

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...