From 03ebf879dfadac9027aa0722bc76aab8ca6aa5e3 Mon Sep 17 00:00:00 2001 From: fnino Date: Wed, 2 Mar 2022 16:08:40 +0100 Subject: [PATCH] Fix utf-8 bug for tj3ts_receiver When decoding an attachment the line.encoding is set to "ASCII-8BIT", even when reading an UTF-8 attachment. So, force the encoding indication and then check its compliant. --- lib/taskjuggler/UTF8String.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/taskjuggler/UTF8String.rb b/lib/taskjuggler/UTF8String.rb index 3bf9e5ee..c113bbbe 100644 --- a/lib/taskjuggler/UTF8String.rb +++ b/lib/taskjuggler/UTF8String.rb @@ -127,6 +127,7 @@ def forceUTF8Encoding else begin # Ensure that the text has LF line ends and is UTF-8 encoded. + force_encoding("UTF-8") encode('UTF-8', :universal_newline => true) rescue # The encoding of the String is broken. Find the first broken line and