Forum: Ruby on Rails Strange problem when using crypt.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A74dc73058b049832872a74a066669eb?d=identicon&s=25 tobyclemson@gmail.com (Guest)
on 2007-07-30 17:10
(Received via mailing list)
Hi there,

I'm trying to utilise the crypt/rijndael algorithm in rails. I've
written a small script separate from rails that takes a string and
using a specified key encrypts it and saves it to a file.

I then would like to be able to copy the string in that file and paste
it into my rails application source and decrypt it using the
decrypt_block method of rijndael.

The trouble is the string changes between the file and the pasted text
in rails. I mean it looks that same but if I puts it out from rails it
is different. I think this must be a character encoding problem but
I'm not sure...

Does anyone have any ideas?

Thanks,
Toby
A0a202fbf532d142ae42112ef1ada1da?d=identicon&s=25 Christopher E. Franklin, Sr. (Guest)
on 2007-07-30 17:46
(Received via mailing list)
What OS? What ar eyou using to open the file?

On Jul 30, 8:10 am, "tobyclem...@gmail.com" <tobyclem...@gmail.com>
A74dc73058b049832872a74a066669eb?d=identicon&s=25 tobyclemson@gmail.com (Guest)
on 2007-07-30 17:50
(Received via mailing list)
Sorry should have been more explicit - I'm on OS X and I'm using
TextMate.

After playing around I've found that if I save the file using MacRoman
as the character encoding it works the way I expected.

Nonetheless I'd like to know a way of doing it even if the file is
saved in UTF-8.

On Jul 30, 4:45 pm, "Christopher E. Franklin, Sr."
This topic is locked and can not be replied to.