No, from the XML characters link in my previous posting, these are all possible XML characters:
[#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDEF],
[#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF],
[#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF],
[#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF],
[#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF],
[#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF],
[#x10FFFE-#x10FFFF].
No way to have a 0x00 byte inside as in my example.
If you need to process binary data, since 2015 use GatewayScript for that and not XSLT.
------------------------------
Hermann Stamm-Wilbrandt
Compiler Level 3 support
IBM DataPower Gateways (⬚ᵈᵃᵗᵃ / ⣏⠆⡮⡆⢹⠁⡮⡆⡯⠂⢎⠆⡧⡇⣟⡃⡿⡃)
https://stamm-wilbrandt.de/en/blog/
------------------------------
Original Message:
Sent: Tue September 26, 2023 03:08 PM
From: Nitish Sinha
Subject: Getting error "Valid base64 passed to dp:decode resulted in non UTF8" in Datapower
Hi Hermann,
Can this buffer value be utilised in xslt for further decryption?
------------------------------
Nitish Sinha
Original Message:
Sent: Tue September 26, 2023 05:22 AM
From: Hermann Stamm-Wilbrandt
Subject: Getting error "Valid base64 passed to dp:decode resulted in non UTF8" in Datapower
Hi,
XSLT is for processing XML.
DataPower internal encoding is UTF-8.
When you do base64 decoding you get that error if the base64 string was not created from a string of UTF-8 encoded XML characters.
Such strings you cannot process in XSLT, but easily in GatewayScript with Buffer datatype:
$ echo -ne "foo\x00bar" | base64
Zm9vAGJhcg==
$
In nodejs or GatewayScript:
> new Buffer('Zm9vAGJhcg==', 'base64')
<Buffer 66 6f 6f 00 62 61 72>
>
------------------------------
Hermann Stamm-Wilbrandt
Compiler Level 3 support
IBM DataPower Gateways (⬚ᵈᵃᵗᵃ / ⣏⠆⡮⡆⢹⠁⡮⡆⡯⠂⢎⠆⡧⡇⣟⡃⡿⡃)
https://stamm-wilbrandt.de/en/blog/
Original Message:
Sent: Wed September 13, 2023 08:17 AM
From: Jyoti Yadav
Subject: Getting error "Valid base64 passed to dp:decode resulted in non UTF8" in Datapower
Hello Team,
Getting error "Valid base64 passed to dp:decode resulted in non UTF8" in Datapower using XSLT while try to decode base64 encoded string
------------------------------
Jyoti Yadav
------------------------------