# Download Problem

**URL:** <https://www.ruby-forum.com/t/download-problem/133201>\
**Category:** Rails\
**Created:** [March 28, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/download-problem/133201 "2008-03-28T17:57:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sigma](https://www.ruby-forum.com/u/sigma)\
**Post date:** [March 28, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/download-problem/133201/1 "2008-03-28T17:57:11Z")

</div>

Hi there

I’ve got following strange problem.  
Follwing code:  
send\_data(originalString, :filename =\> “foo.bar”, :type =\>  
‘text/plain; charset=utf-8’ )

I send the file “foo.bar” to the browser. If I save it, the charset  
isn’t utf-8, its “ansi”

What must I change, when I want utf-8?

Greets

---

<div class="post-metadata">

**Author:** ![sigma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sigma](https://www.ruby-forum.com/u/sigma)\
**Post date:** [March 28, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/download-problem/133201/2 "2008-03-28T19:05:26Z")

</div>

I don’t know. But the problem appears with FF (OSX & Vista), Safari and  
IE7

any idea?

---

<div class="post-metadata">

**Author:** ![sigma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sigma](https://www.ruby-forum.com/u/sigma)\
**Post date:** [March 28, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/download-problem/133201/3 "2008-03-28T18:20:34Z")

</div>

On 28 Mar 2008, at 16:57, Christoph Thommen wrote:

> isn’t utf-8, its “ansi”
> 
> What must I change, when I want utf-8?

Is the problem that the browser thinks it’s ansi or are the actual  
bytes going over the wire ‘ansi’ ?

Fred

---

<div class="post-metadata">

**Author:** ![sigma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sigma](https://www.ruby-forum.com/u/sigma)\
**Post date:** [March 28, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/download-problem/133201/4 "2008-03-28T19:11:40Z")

</div>

On 28 Mar 2008, at 18:05, Christoph Thommen wrote:

> I don’t know. But the problem appears with FF (OSX & Vista), Safari  
> and  
> IE7

My point was that the content\_type you pass to send\_data won’t change  
the data, so if what you’re pulling out of the database isn’t utf8  
then the browsers won’t see utf8 either.

Fred

---

<div class="post-metadata">

**Author:** ![sigma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sigma](https://www.ruby-forum.com/u/sigma)\
**Post date:** [March 28, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/download-problem/133201/5 "2008-03-28T21:57:35Z")

</div>

Frederick C. wrote:

> On 28 Mar 2008, at 18:05, Christoph Thommen wrote:
> 
> > I don’t know. But the problem appears with FF (OSX & Vista), Safari  
> > and  
> > IE7
> 
> My point was that the content\_type you pass to send\_data won’t change  
> the data, so if what you’re pulling out of the database isn’t utf8  
> then the browsers won’t see utf8 either.
> 
> Fred

I think I’ve to tell the hole story…  
i must generate a spezial datafile (encrypted xml) for a 3rd party  
application.  
the contend is utf-8,but the file itself not… I think it could be a  
problem with the header-informations?  
Any idea?

Greets
