Author Topic: [v1.7.3.1] "Set a Text Value" action cannot read unicode from file correctly  (Read 1542 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
When the "Set a Text Value" action is used with unicode characters directly, it works as expected:
Code: [Select]
Set Text [~text] to '“ ’ À ¢'
Write [Blue] '{TXT:~text}' to log
Will write "“ ’ À ¢" to the log.

However, if those same characters are read from a file using this action, they are not recognized properly:
Code: [Select]
Set Text [~text] to [C:\special characters.txt]
Write [Blue] '{TXT:~text}' to log
Will write "� � � �" to the log(ASCII code 65533).


I believe this is the underlying issue.

Notepad, which I used to create the text file, uses ANSI encoding by default.


EDIT: Noted in the documentation for v1.7.3.2
« Last Edit: February 17, 2019, 12:33:24 AM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
I guess I would need to provide a selection of encodings for the user to choose from.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
The reader reads UTF-8 by default (which is what it is set to).  I don't know if I want to overload that section too much.  I may just update the doc to indicate that the encoding should be UTF-8 to be fully compatible.  Thanks for bringing this to my attention.