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

Hi communities, I encountered some coding problems, I don't know if this is a bug.

 

Background:

Using ODS RTF procedure, the Unicode SAS outputed a RTF file, but the title/author/last modifier of MS Word is garbled.

Bill3_1-1751797886003.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
whymath
Lapis Lazuli | Level 10
It should be the same reason said by Yinliang Wu: https://blogs.sas.com/content/sgf/2023/08/31/review-garbage-characters-in-rtf-output-on-unicode-sas/

This paper gives a solution to output right Chinese text when using pretext= or posttext= option in UTF8 enviroment, but no document info mentioned here.

To mannually set document info, you can use title=, author= and operator= options in ods rtf statement. Very luckily, these options will output right Chinese characters rather than garbage characters, which are produced by omitting these options.

View solution in original post

4 REPLIES 4
Bill3
Fluorite | Level 6
my language is chinese
Tom
Super User Tom
Super User

Are you saying that when you open the RTF file in WORD (so that WORD will convert it into a WORD file) and then check the Author attributes the text looks like it might have been transcoded incorrectly?

 

To see if the problem is with SAS's generation of the RTF file or with WORD's reading of  the RTF file examine the RTF file using a TEXT editor.

Bill3
Fluorite | Level 6
\info{\title \'E7\'89\'88\'E6\'9C\'AC 9.4 SAS \'E7\'B3\'BB\'E7\'BB\'9F\'E8\'BE\'93\'E5\'87\'BA}{\author SAS \'E7\'89\'88\'E6\'9C\'AC 9.4}{\operator SAS \'E7\'89\'88\'E6\'9C\'AC 9.4} I think this UTF8 cannot be recognized in MS Word?
whymath
Lapis Lazuli | Level 10
It should be the same reason said by Yinliang Wu: https://blogs.sas.com/content/sgf/2023/08/31/review-garbage-characters-in-rtf-output-on-unicode-sas/

This paper gives a solution to output right Chinese text when using pretext= or posttext= option in UTF8 enviroment, but no document info mentioned here.

To mannually set document info, you can use title=, author= and operator= options in ods rtf statement. Very luckily, these options will output right Chinese characters rather than garbage characters, which are produced by omitting these options.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 734 views
  • 1 like
  • 3 in conversation