From: Brian Candler Date: 2007-02-09T21:10:02+09:00 Subject: Re: Problem with Base64 decoding On Fri, Feb 09, 2007 at 09:01:20PM +0900, alexander wrote: > i just needed to [3..-1] that out of the way and everything works > perfectly now... (crossing my fingers now that the app that�s producing > those files doesn�t put illegal characters somewhere in the middle of > the files, but that hasn�t happened yet.) Maybe just gsub! everything else out. Untested: gsub!(/[^A-Za-z0-9+\/=]/, '')