From: "Iñaki Baz Castillo" Date: 2008-03-26T07:03:22+09:00 Subject: Re: Is possible Ruby to use CRLF instead of LF? El Martes, 25 de Marzo de 2008, Xavier Noria escribió: > In the source code a hard-newline like the one in a here-document has > only LFs as long as the file has the newline conventions of the > runtime platform. That's because the Ruby interpreter itself reads the > program as a text file in text mode. > > If you want to force CRLF in a here-document you can use a trick like > this (off the top of my head): > > example = < ... > EOS > > class String > def lf_to_crlf > gsub(/\012/, "\015\012") > end > end > > Then the I/O channel used to send the data needs to be in binary mode, > etc. Thanks, finally that it what I did (similar): example =<-- END_STRING Version 4 Request_Type: call From: sssss END_STRING example.gsub!(/\n/,"\r\n") Thanks a lot. -- Iñaki Baz Castillo