Sign in to follow this  
neosoro

Help with accent pt-Br

Recommended Posts

Hi Rodrigo,

 
To insert the accent characters you would need to first add BOM characters to the file after that need to encode your string with utf8_encode() function.
 
Please see the following code for an example:
 $fp = fopen("relatorios/DataXMLFusion.xml" , "w");
 $fw = fwrite($fp, "xEFxBBxBF");

 $fw = fwrite($fp,utf8_encode($xml)); 

 
Hope this helps.

Edited by Guest

Share this post


Link to post
Share on other sites

Thank you so much! You saved my life heheheheheheheheheh. Actually your tip it was a little bit wrong. I've changed and it works. If someone have the same trouble it is just add at the beginning of the code:

 


$xml = "xEFxBBxBF";

 

And in script that generate the file:

 


$fw = fwrite($fp,utf8_decode($xml));

 

 

 

It's to decode the string to print on the screen, but I have to thank Mr. Rahul Kumar for help me to see my error. Thanks again!

 

 

 

Rodrigo Nascimento

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this