Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-03-22 01:15 PM
Hi Experts
I am trying to read the settings file for OneDrive (%LocalAppData%\Microsoft\OneDrive\settings\Business1\{GUID}.ini) with the Read All Text From File activity.
I can see that it returns a result of 3,238 characters. But when I try open the variable I can only see the very first character. I have also tried to use the Read Lines From File which returns a collection. The collection if populated as expected but when I open the collection the text disappears when I click the row.
When I open the file in Notepad I can see that it is using UTF-16 LE encoding. Also the content is only 1,619 characters (half of what Blue Prism interprets).
My guess is that it is due to the encoding - any ideas on how to sort this out?
------------------------------
Jacob Christensen
IT Consultant
------------------------------
I am trying to read the settings file for OneDrive (%LocalAppData%\Microsoft\OneDrive\settings\Business1\{GUID}.ini) with the Read All Text From File activity.
I can see that it returns a result of 3,238 characters. But when I try open the variable I can only see the very first character. I have also tried to use the Read Lines From File which returns a collection. The collection if populated as expected but when I open the collection the text disappears when I click the row.
When I open the file in Notepad I can see that it is using UTF-16 LE encoding. Also the content is only 1,619 characters (half of what Blue Prism interprets).
My guess is that it is due to the encoding - any ideas on how to sort this out?
------------------------------
Jacob Christensen
IT Consultant
------------------------------
Answered! Go to Answer.
1 BEST ANSWER
Helpful Answers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-03-22 03:15 PM
Hi @Jacob Christensen,
Try changing the definition of the Read Lines action Code stage such that it specifies the encoding. Really, you'd want to make a copy of the action and change the copy, but changing the original is a quick and easy test. A value of Encoding.Unicode results in UTF 16 Little Endian.

Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Try changing the definition of the Read Lines action Code stage such that it specifies the encoding. Really, you'd want to make a copy of the action and change the copy, but changing the original is a quick and easy test. A value of Encoding.Unicode results in UTF 16 Little Endian.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-03-22 03:15 PM
Hi @Jacob Christensen,
Try changing the definition of the Read Lines action Code stage such that it specifies the encoding. Really, you'd want to make a copy of the action and change the copy, but changing the original is a quick and easy test. A value of Encoding.Unicode results in UTF 16 Little Endian.

Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Try changing the definition of the Read Lines action Code stage such that it specifies the encoding. Really, you'd want to make a copy of the action and change the copy, but changing the original is a quick and easy test. A value of Encoding.Unicode results in UTF 16 Little Endian.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-03-22 07:57 AM
Thanks Eric - that sorted out the problem. I copied the Read All Text From File activity and added the System.Text.Encoding.Unicode to the StreamReader part and it works fine.
------------------------------
Jacob Christensen
IT Consultant
------------------------------
------------------------------
Jacob Christensen
IT Consultant
------------------------------
