I tried to import Simplified Chinese rtf files with following code, but the all simplified Chinese word will become like below.
Is there any method that I could get the simplified Chinese word?
filename rtf "xxxxxxxxxxxxxxxxxx\&output..rtf";
data rtf_input;
infile rtf
delimiter='00'x MISSOVER DSD lrecl=32767
firstobs=1;
format f1 $500.;
input
f1 $ ;
run;
Since RTF is not intended for data interchange I wish you lots of luck with this project.
I would recommend to try saving the file to plain text format so most of the RTF code tags go away. That might make reading the file a lot simplier.
What do you mean by "simplified Chinese word"?
I am totally unfamiliar with these issues, so this question might be wholly naïve: have you set session encoding, and filename encoding?
See 16355 - Does SAS support UTF-16 encoding?.
I looked at the third character 分 (the easiest to identify to my western eyes).
According to https://www.yellowbridge.com/chinese/charsearch.php?zi=%E5%88%86
The document seems to use gb2312 encoding.
I am unsure that SAS supports it. If not, you'll have to transcode to UTF (and use a UTF SAS session).
So you'll have to read the value B7D6 and transform it to U+5206.
you'll have to read the value B7D6 and transform it to U+5206. As you mention,how could I transform B7D6 to U+5206?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.