Here’s the updated code, and it’s still adding extra characters:
——
set inVal [lindex $xlateInVals 0]
set outVal “”
package require base64
package require uuencode
set ucode [lindex $xlateInVals 0]
echo $ucode
set ucode [string map { \\X0D\\ \r \\X0A\\ \n \\F\\ | \\S\\ ^ \\T\\ & \\R\\ ~ \\E\\ \\ } $ucode]
echo $ucode
set ucode [join [lrange [split $ucode \r\n] 1 end] \r\n]
echo $ucode
set pdf [uuencode::decode $ucode]
echo $pdf
set b64 [base64::encode -wrapchar “” $pdf]
echo $b64
# set b64 [string range $b64 1 end]
set xlateOutVals $b64
<hr />
Here are some of the initial echos that I have:
Direct data (first ucode): begin 644 WAV.DAT\X0D\\X0A\M)5!$1BTQ+C*)>+CS]/H"B@-2`P(\T\]B:CP\E\+U1Y<\T\4@+
second ucode: begin 644 WAV.DAT
M)5!$1BTQ+C*)>+CS]/H"B@-2`P(&]B:CP\+U1Y<&4@+T-A=&%L;V<@+U!A
Third ucode: M)5!$1BTQ+C*)>+CS]/H"B@-2`P(&]B:CP\+U1Y<&4@+T-A=&%L;V<@+U!A
pdf: Lot of binary data that is unreadable:
b64: tJVBERi0xLjAKJeLjz9PoCiAgNSAwIG9iajw8L1R5cGUgL0NhdGFsb2cgL1BhqtZ2VzIDE
The issue is in the b64 value, there are a lot of ‘t’ and ‘qt’ characters that are in place:
t JVBERi0xLjAKJeLjz9PoCiAgNSAwIG9iajw8L1R5cGUgL0NhdGFsb2cgL1Bh qt Z2VzIDE
If I leave off the -wrapchar “”, the PDF is then broken into newlines, and that’s where the qt seems to come into play, but not sure why they’re being inserted like that. If I leave the \r in place it puts a lot of extra tqt characters.
Not really sure what is going on with this.