How To: Remove WhiteSpaces Added when Base64 Encoding Long Strings

Base64 encoding inserts line breaks every 76 characters. When Base64 encoding long strings you might run into the case where white spaces, especially line breaks are added.  You can get rid off the white spaces by adding a Pattern Match Task as follows:

I. Add a Pattern Match Policy:

     1. Go to Resources-->Pattern Match
     2. Click New and Name the Policy, for example "Remove_White_Spaces"
     3. Mode is Allow
     4. Under Regular Expression type (\r\n|\n|\r)
     5. Under Replacement leave blank (no Value)
     6. Check Replace and Save

II. Add a Pattern Match Task

     1. Go to Gateway---> Task Lists
     2. Click on the Task List you want to apply this to or click New to create a new Task List
     3. Click New and select Pattern Match task. Name your Task, for example "Strip White Space"
     4. Click New under Match Policies
     5. Select User Attribute under Type
     6. Under Name type in the attribute name you placed the encoded value into
     7. Under Policy Name select the Pattern Match Policy you have create (Remove_White_Spaces)
     8 Click Save
III. Finally, move the new Pattern Match Task right below the convert task you are using to base64 encode


Article is closed for comments.