BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sathasivam
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@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;

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

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.

sathasivam
Fluorite | Level 6

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

Tom
Super User Tom
Super User

@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;

sathasivam
Fluorite | Level 6

Thanks Tom, It's working!!!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1443 views
  • 0 likes
  • 2 in conversation