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

Hi Chris,

Thanks for your great solution. It's working!

Just like you said, It's because EG could not detect the encoding in my SAS program by default.

 

Kurt_Bremser
Super User

@ChaseLiu wrote:

It's because EG could not detect the encoding in my SAS program by default.

 


Which happens because your IDE does not supply the BOM that tells other software that the file is UTF coded. You might look if there's an option for that.

ChaseLiu
Obsidian | Level 7

@Kurt_Bremser You are right.Smiley Happy The editor save file in UTF-8 without BOM by default. Thanks for you advice! I think my confuse has been completely addressed.

Spoiler
 

.

 

NMad
Fluorite | Level 6
"Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature"
DumptyHumpty
Calcite | Level 5

I had a related issue with thousands of *.sas files from external sources in UTF8 that were incorrectly handled by the EG due to the missing Byte Order Mark (BOM) in the files. Opening and saving them manually in EG with the correct encoding information was not an option. 

I added the BOM programmatically which made EG detect the encoding correctly. Due to my personal preferences I coded it in linux bash. Powershell should look similiar.

 echo -ne '\xEF\xBB\xBF' > prog_utf8_BOM.sas && cat prog_utf8.sas >> prog_utf8_BOM.sas &&  mv prog_utf8_BOM.sas prog_utf8.sas

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 19 replies
  • 8700 views
  • 5 likes
  • 7 in conversation