Hello all,
I have a dataset encoded in Latin1 and we are trying to create an XML file in UTF-8.
In generated XML file, a french character "è" is appearing as strange character (xE8)
Even I tried to change the dataset to UTF-8 before creating XML file, but still the strange character exists.
Requesting you to help me to resolve this issue
Thank you
@sathasivam wrote:
Hi Tom,
Thanks for your response. Am using data set and I have already used the same in my code as below:
data com;
file "C:/temp/file1.xml";put '<?xml version="1.0" encoding="UTF-8"?>';
Thanks
That is just telling the future users of the resulting file to interpret the text as UTF-8. That is not going to make an difference to how SAS will write the values into the file.
data com;
file "C:/temp/file1.xml" encoding='utf-8';
put '<?xml version="1.0" encoding="UTF-8"?>';
...
run;
HOW did you try to create the XML file?
If you are using data step and PUT statement to write it then make sure the ENCODING option is set on the FILE or FILENAME statement.
Hi Tom,
Thanks for your response. Am using data set and I have already used the same in my code as below:
data com;
file "C:/temp/file1.xml";
put '<?xml version="1.0" encoding="UTF-8"?>';
Thanks
@sathasivam wrote:
Hi Tom,
Thanks for your response. Am using data set and I have already used the same in my code as below:
data com;
file "C:/temp/file1.xml";put '<?xml version="1.0" encoding="UTF-8"?>';
Thanks
That is just telling the future users of the resulting file to interpret the text as UTF-8. That is not going to make an difference to how SAS will write the values into the file.
data com;
file "C:/temp/file1.xml" encoding='utf-8';
put '<?xml version="1.0" encoding="UTF-8"?>';
...
run;
Thanks Tom, It's working!!!!
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: