# Again: invalid byte sequence in US-ASCII

**URL:** <https://rubytalk.org/t/again-invalid-byte-sequence-in-us-ascii/62591>\
**Category:** ruby-talk\
**Created:** [1 May 2011 11:11 UTC](https://rubytalk.org/t/again-invalid-byte-sequence-in-us-ascii/62591 "2011-05-01T11:11:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sven\_Koesling](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Sven\_Koesling](https://rubytalk.org/u/Sven_Koesling)\
**Post date:** [1 May 2011 11:11 UTC](https://rubytalk.org/t/again-invalid-byte-sequence-in-us-ascii/62591/1 "2011-05-01T11:11:26Z")

</div>

Hello everybody,

again I have problems with the f.ckn german umlauts 😉 This time within  
a cgi script.

I try to parse the output from a shell script, e.g.: 'Ich habe viele  
Wünsche'  
While reading ruby (1.9.2) complains with "invalid byte sequence in  
US-ASCII" so I tried to enforce utf8.  
Now the reading works, but on my website I get the output "Ich habe  
viele W\u00FCnsche"

Do You have a hint for me?

Thanks a lot,  
greetings  
Sven

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Markus\_Fischer](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Markus\_Fischer](https://rubytalk.org/u/Markus_Fischer)\
**Post date:** [1 May 2011 11:32 UTC](https://rubytalk.org/t/again-invalid-byte-sequence-in-us-ascii/62591/2 "2011-05-01T11:32:16Z")

</div>

Hi,

> **···**
>
> On 01.05.2011 13:11, Sven Koesling wrote:
> 
> > I try to parse the output from a shell script, e.g.: 'Ich habe viele  
> > Wünsche'  
> > While reading ruby (1.9.2) complains with "invalid byte sequence in  
> > US-ASCII" so I tried to enforce utf8.  
> > Now the reading works, but on my website I get the output "Ich habe  
> > viele W\u00FCnsche"
> > 
> > Do You have a hint for me?
> 
> Could you provide a short self-contained example?
> 
> thx

---

<div class="post-metadata">

**Author:** ![Sven\_Koesling](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Sven\_Koesling](https://rubytalk.org/u/Sven_Koesling)\
**Post date:** [1 May 2011 11:42 UTC](https://rubytalk.org/t/again-invalid-byte-sequence-in-us-ascii/62591/3 "2011-05-01T11:42:12Z")

</div>

Oh my good, I am such an idiot. Forgive me for steeling Your time!  
Here is the solution:  
Put this in the html header:

\<meta http-equiv="Content-Type" content="text/html;charset=utf-8" \>

Again: so sorry!  
Have a nice weekend,  
best,  
Sven

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
