# Accessing the raw/un-html-ized CGI parameters

**URL:** <https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140>\
**Category:** Ruby\
**Created:** [June 22, 2006, 12:33pm UTC](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140 "2006-06-22T12:33:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandru\_ESUngur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Alexandru\_ESUngur](https://www.ruby-forum.com/u/Alexandru_ESUngur)\
**Post date:** [June 22, 2006, 12:33pm UTC](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140/1 "2006-06-22T12:33:12Z")

</div>

Hi all,

Does anybody know how can I access the raw CGI parameters?  
For example I enter this in a textarea:

```
qweÅ?lÅ£qwe.com

```

and get this value instead:

```
qwe&#351;l&#355;qwe.com

```

with the language specific characters turned into HTML entities,  
which is not exactly what I need… How can I access the raw  
string? Or can I prevent this conversion to take place… ?

Thank you in advance,  
Alex

---

<div class="post-metadata">

**Author:** ![Alexandru\_ESUngur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Alexandru\_ESUngur](https://www.ruby-forum.com/u/Alexandru_ESUngur)\
**Post date:** [June 22, 2006, 7:04pm UTC](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140/2 "2006-06-22T19:04:41Z")

</div>

What is this? Webrick, Mongrel, Rails, etc. Difficult to help if we  
have no idea what libraries you are using.

---

<div class="post-metadata">

**Author:** ![Alexandru\_ESUngur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Alexandru\_ESUngur](https://www.ruby-forum.com/u/Alexandru_ESUngur)\
**Post date:** [June 22, 2006, 9:30pm UTC](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140/3 "2006-06-22T21:30:43Z")

</div>

> > > sender: “Simen E.” date: “Fri, Jun 23, 2006 at 02:03:55AM +0900” \<\<\<EOQ  
> > > What is this? Webrick, Mongrel, Rails, etc. Difficult to help if we  
> > > have no idea what libraries you are using.  
> > > Thanks for trying 🙂 and sorry for being so vague.  
> > > I am using Apache, plain Ruby run as cgi and the standard cgi module,  
> > > like this:

require ‘cgi’

cgi = CGI.new  
cgi[‘[idn-domain-name-here.com](http://idn-domain-name-here.com)’] # == BIG\_SURPRISE! 🙂

I enter this ‘qweÅ?[lÅ£qwe.com](http://xn--lqwe-bfa7r.com)’ and get this ‘qweşlţqwe.com’  
instead. I solved the problem by using ‘htmlentities’:  
[http://htmlentities.rubyforge.org/](http://htmlentities.rubyforge.org/)  
which btw, works excellent, but I’d still be interested if there is  
a solution to achieve this just by using the cgi module itself (and  
preventing the encoding in the first place).

Thank you!  
Alex

---

<div class="post-metadata">

**Author:** ![Alexandru\_ESUngur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Alexandru\_ESUngur](https://www.ruby-forum.com/u/Alexandru_ESUngur)\
**Post date:** [June 23, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/accessing-the-raw-un-html-ized-cgi-parameters/64140/4 "2006-06-23T14:55:23Z")

</div>

I would be interested to know if someone has a more core-ruby solution?
