It was suggested I post this question here instead of as a reply to the original thread:
I am using AmberV’s great little splitter script from this discussion:
https://literatureandlatte.com/web/forum/viewtopic.php?f=2&t=52114
In that thread it was already mentioned that
The solution suggested was to add the line
ARGF.set_encoding(Encoding::UTF_8)
at the beginning of the script.
However, this did not resolve the issue in my case.
I am getting the following message:
[code]/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/delegate.rb:341:in write': U+00E9 from UTF-8 to US-ASCII (Encoding::UndefinedConversionError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/delegate.rb:341:in
print’
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/delegate.rb:341:in block in delegating_block' from /var/folders/11/yyzl685d0h11s7ctdldn02pc0000gn/T/my-script:26:in
block in ’
from /var/folders/11/yyzl685d0h11s7ctdldn02pc0000gn/T/my-script:13:in each' from /var/folders/11/yyzl685d0h11s7ctdldn02pc0000gn/T/my-script:13:in
’
[/code]
I am using IPA characters, such as this one here ʧ which seems to be the culprit (Without that character the script runs fine, although that is not the Unicode character U+00E9 that is listed in the error message, which is just the accented é).
Any help much appreciated!