SVN commit log for that one:

"Chris set us up the BOM"

=-D

On 11/7/07, Chris Abad <[EMAIL PROTECTED]> wrote:
>
> I got it working. The BOM did it. Just in case you're curious, this is
> what I used:
> send_data "\xEF\xBB\xBF" + @page.body, :type => 'text/
> plain', :filename => @page.permalink_segments.join('_') + '.txt'
>
> On Nov 6, 4:04 pm, Stephen Waits <[EMAIL PROTECTED]> wrote:
> > Chris Abad wrote:
> > > Great suggestion, that may be our problem. Some text editors just
> > > aren't picking up the UTF-8 text files, and including a BOM may help
> > > in those situations... right now we're just using this:
> >
> > > send_data @page.body, :type => 'text/plain', :filename =>
> > > @page.permalink_segments.join('_') + '.txt'
> >
> > > Anyone happen to know how to add a BOM to the beginning of my file?
> >
> > First get the BOM into a string..  does this work?
> >
> >    utf8bom = [0xef,0xbb, 0xbf].pack('c*')
> >
> > Then you have to prepend it onto your output stream.  How about this?
> >
> >    send_data (utf8bom + @page.body), :type => 'text/plain', ...
> >
> > All of this is completely untested.. :)
> >
> > --Steve
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
sdruby@googlegroups.com
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to