On 17 July 2014 15:42, Eric Saupe <[email protected]> wrote:
> Colin,
>
> That shows how to create a Tempfile with a given encoding but the question
> is when a user uploads a file through a form and Rails creates a Tempfile is
> there a way to indicate that it should always create those Tempfiles with a
> default encoding such as UTF-8?

In that case it *is* a Rails specific issue, not a Ruby question as
suggested by the OP.

Colin

>
> On Thursday, July 17, 2014 8:12:27 AM UTC-6, Colin Law wrote:
>>
>> On 17 July 2014 10:22, Ronald Fischer <[email protected]> wrote:
>> > As far I understand this article, this related to Rails 3 and MySQL, and
>> > how to use UTF8 encoded data everywhere. I don't know about MySQL, but
>> > Rails 4 and Ruby 2 with SQLite don't suffer this problem: I didn't have
>> > any trouble, processing all kinds of Unicode characters with my
>> > application, and processing the uploaded file also works fine, as long I
>> > use my (not very elegant) trick to open it a second time with the
>> > desired encoding.
>> >
>> > It now occurs to me, that the question is maybe not Rails-specific, but
>> > a general Ruby question - how to change the encoding of a Tempfile
>> > object.
>>
>> I have not been following this thread in detail, but [1] discusses how
>> to use the encoding option when creating a Tempfile.
>>
>> [1]
>> http://www.ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html
>>
>> Colin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/6af117a7-b554-4ada-84b3-3a362c3e0973%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuG03vQ%3D0vaP7G_bc5945RCjWWsvs5dsND-CkGDr-%3DTFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to