Setting default Character Encoding
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-05-17 07:38 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-05-17 05:22 PM
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)
