on 06-24-2022 3:02 PM
We have a workflow task integrated into My Inbox, to which prior to the approval step attachments are uploaded in SBWP, either in RAW or TXT format and with UTF-8 encoding.
To be able to make a decision, approvers open these attachments from My Inbox.
Problem is, that on mobile and tablet - where the approval is mostly used - the browser open these attachment files inline and non-ASCII characters are displayed inproperly.
I've noticed that the HTTP response returning the file contains the following header:
Content-Type: text/plain
which if being extended with the charset=UTF-8 addition the problem is solved.
Currently I use an implicit enhancement at the end of method /IWPGW/CL_TGW_TASK_FACADE_BWF~/IWPGW/IF_TGW_TASK_FACADE~READ_TASK_ATTACHMENT_STREAM with the following coding:
DATA encoding LIKE cl_abap_file_utilities=>encoding_utf8.
IF substring_before( val = es_attachment_stream-mime_type sub = '/' ) = 'text'.
cl_abap_file_utilities=>check_xstring_utf8(
EXPORTING
xstring = es_attachment_stream-value
IMPORTING
encoding = encoding ).
IF encoding = cl_abap_file_utilities=>encoding_utf8.
es_attachment_stream-mime_type = es_attachment_stream-mime_type && |; charset=UTF-8|.
ENDIF.
ENDIF.
Is there a neater way to achieve this? I'm not sure if it is a bug, as by default the attachment is meant to be downloaded by the browser (which is the case in desktop).
As I did not find any better solution I kept using this one. No drawbacks or side-effects was identified so far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.