cancel
Showing results for 
Search instead for 
Did you mean: 

Setting default Character Encoding

LokeshRaj1
Level 3
Hello Friends, Is it possible to make UTF 8 as default encoding . currently the File management write file functionality has default ANSI coding, but it is giving some junk or special characters in CSV file. when the csv file is saved as UTF8 Encoding ,the text returns to normal font(Manually opening the file and selecting UTF8 &saving it). Kindly provide some suggestions to overcome the issue. thanks, lraj
1 REPLY 1

Denis__Dennehy
Level 15
Looking at the code stage used in the Write File action I can see it is using a .NET command called WriteAllText. I googled 'WriteAllText UTF8' and it came back with lots of results that should be useful for you if you want to create your own UTF8 action. Specifically, it looks like the WriteAllText method has an encoding parameter that the Write Text File action is not using. That parameter can be set to the correct System.Text.Encoding value for UTF8 which seems to be 65001. So your write text command would probably need to be something like: File.WriteAllText(path, createText, 65001)