﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Aaron West  / BASE64 Encode and Decode in T-SQL - optimized / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 23:58:46 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: BASE64 Encode and Decode in T-SQL - optimized</title><link>http://www.sqlservercentral.com/Forums/Topic410316-898-1.aspx</link><description>Remove whitespace before calling the function. Use SUBSTITUTEIf you uncomment this code it would return null:--IF @encoded_text COLLATE LATIN1_GENERAL_BIN-- LIKE '%[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=]%'--     COLLATE LATIN1_GENERAL_BIN--  RETURN NULLtry: SET @encoded_text = SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(       @encoded_text, ' ',''),CHAR(9),''),CHAR(10),''),CHAR(13),'')(Okay so 5 years for me to bother to check the discussion is a bit long. I use Oracle lately...)</description><pubDate>Wed, 16 Jan 2013 14:05:13 GMT</pubDate><dc:creator>Aaron West</dc:creator></item><item><title>RE: BASE64 Encode and Decode in T-SQL - optimized</title><link>http://www.sqlservercentral.com/Forums/Topic410316-898-1.aspx</link><description>Thanks for this. I nearly used this function.</description><pubDate>Wed, 14 Apr 2010 23:46:28 GMT</pubDate><dc:creator>ZA_Crafty</dc:creator></item><item><title>RE: BASE64 Encode and Decode in T-SQL - optimized</title><link>http://www.sqlservercentral.com/Forums/Topic410316-898-1.aspx</link><description>:-PThanks!It's very useful for me.</description><pubDate>Tue, 17 Mar 2009 20:01:27 GMT</pubDate><dc:creator>lyout</dc:creator></item><item><title>RE: BASE64 Encode and Decode in T-SQL - optimized</title><link>http://www.sqlservercentral.com/Forums/Topic410316-898-1.aspx</link><description>I came across a bug(?) in this function.  I'm using it in my proc to decode the base64 encoded string.  My string is this:'This is a really long sentence to see how this thing will crash or if it even will crash I am now at 152 letters and still conting'.It get encoded via an Actionscript function to this:'VGhpcyBpcyBhIHJlYWxseSBsb25nIHNlbnRlbmNlIHRvIHNlZSBob3cgdGhpcyB0aGluZyB3aWxsIGNyYXNoIG9yIGlmIGl0IGV2ZW4gd2lsbCBjcmFzaCBJIGFtIG5vdyBhdCAxNTIgbGV0dGVycyBhbmQgc3RpbGwgY29udGluZy4='What the proc sees is this:This is a really long sentence to see how this thing will&#xB;ò&#x6;7&amp;&#x17;6‚&#x6;÷"&#x6;–b&#x6;—B&#x6;WfVâ&#x7;v–ÆÂ&#x6;7&amp;&#x17;6‚&#x4;’&#x6;&#x16;Ò&#x6;æ÷r&#x6;&#x17;B&#x3;&#x13;S"&#x6;ÆWGFW'2&#x6;P¿nd still conting.For some reason the function bombs at around the 59th place in the string but then picks back up later.  Any ideas why?  The column is defined as varchar(500) so no insert/update problems there.Thanks.</description><pubDate>Wed, 12 Nov 2008 11:24:02 GMT</pubDate><dc:creator>dpassey</dc:creator></item><item><title>BASE64 Encode and Decode in T-SQL - optimized</title><link>http://www.sqlservercentral.com/Forums/Topic410316-898-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Miscellaneous/31520/"&gt;BASE64 Encode and Decode in T-SQL - optimized&lt;/A&gt;[/B]</description><pubDate>Sat, 13 Oct 2007 08:57:49 GMT</pubDate><dc:creator>Aaron West</dc:creator></item></channel></rss>