From: alexander Date: 2007-01-27T04:48:13+09:00 Subject: problem with base64 decode hi there, i�m having a small problem with base64 decoding a string. i�m porting a php script over to ruby and the decoding gives me different results in ruby and in php. the problem is that the php results works for the processing i do afterwards while the ruby version doesn�t. here�s the scripts in question: php: ruby: require 'rubygems' require 'fileutils' require 'base64' all_bytes = Base64.decode64(IO.read("test.rgb")) bitmap = "\xFF\xFE" bitmap << [120,97].pack("n2") bitmap << "\x01" bitmap << "\xFF\xFF\xFF\xFF" bitmap << all_bytes File.new("test_ruby.gd","w").puts(bitmap) the ruby version is one byte shorter. i�m probably missing something rather obvious here, but any pointers to how i can make the ruby output be like the php output would be greatly appreciated :) i�ve uploaded the test.rgb file i�m using to here: http://rss.fork.de/test.rgb if that�s even needed :) thanks a lot, alexander