# Enconding decoding? what to do

**URL:** <https://www.ruby-forum.com/t/enconding-decoding-what-to-do/148299>\
**Category:** Rails\
**Created:** [September 11, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/enconding-decoding-what-to-do/148299 "2008-09-11T15:02:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![drlelon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee59a6/32.png) [@drlelon](https://www.ruby-forum.com/u/drlelon)\
**Post date:** [September 11, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/enconding-decoding-what-to-do/148299/1 "2008-09-11T15:02:54Z")

</div>

I have this output:  
Using \<%= string%\> or \<%=h string%\>

Velkommen+til+Personalebasen%2E%0D%0A%0D%0ADu+har+f%E5et+tildelt+et  
+brugerID%3A+4531711982…

And this output:  
Using \<%=u string%\>  
Velkommen%2Btil%2BPersonalebasen%252E%250D%250A%250D%250ADu%2Bhar%2Bf  
%25E5et%2Btild…

Its an output from an sms gateway. So I cannot manipulate the source.

But I want the output to be humanly readable. The output is danish for  
those wondering.

No native decoding option ? Or do I need to do some RegExp magic?  
( hope not, i’m afraid of RegExp ^^ )

Thx in advance

David

---

<div class="post-metadata">

**Author:** ![drlelon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee59a6/32.png) [@drlelon](https://www.ruby-forum.com/u/drlelon)\
**Post date:** [September 11, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/enconding-decoding-what-to-do/148299/2 "2008-09-11T16:24:42Z")

</div>

On 11 Sep 2008, at 14:02, David L. wrote:

> %25E5et%2Btild…
> 
> Its an output from an sms gateway. So I cannot manipulate the source.
> 
> But I want the output to be humanly readable. The output is danish for  
> those wondering.

CGI.unescape
