# Converting string to ASCII or similar

**URL:** <https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396>\
**Category:** flash\
**Created:** [December 22, 2003, 12:42pm UTC](https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396 "2003-12-22T12:42:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScriptFlipper](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@ScriptFlipper](https://forum.kirupa.com/u/ScriptFlipper)\
**Post date:** [December 22, 2003, 12:42pm UTC](https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396/1 "2003-12-22T12:42:12Z")

</div>

Hi!  
I have a small problem. In Sweden we have these characters å, ä and ö (and of course also in caps). But my MySQL db can’t store åäö characters, so if I look in the db and search for my name, Boström, i can’t find it…  
(this forum must encode them in some way, right?)

The search is ran from within flash (mx2004, and from there to a php-script, wich then sends the matching row back to flash.

I want to convert all the åäö’s in a string, and to be able to reconvert them when flash gets the string back… So the string should be stored in the db with the åäö encoded…  
(am I confusing you now?)

And I can’t use the html-code for å (å) 'cause if the php-script prints this:  
&str=Bostråm  
the AS will think that str=Bostr (it stops at the other &-sign…)

(and what if there are multiple instances of the characters åäö in a string?)

Wow… quite an explanation…  
Ok, short summary:

AS-sting: Boström  
\>encode (so that ö=ASCII or so)  
\>send to PHP-script  
\>store in MySQL-db  
\>SELECT from db in PHP  
\>print string  
\>get into AS  
\>decode  
\>display string: Boström

thank tou very much in advance!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 22, 2003, 3:41pm UTC](https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396/2 "2003-12-22T15:41:03Z")

</div>

Why don’t you use the [font=courier new]escape()[/font] and [font=courier new]unescape()[/font] functions to URL-encode the string? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 22, 2003, 3:55pm UTC](https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396/3 "2003-12-22T15:55:53Z")

</div>

Equivalent function in PHP is urlencode 😉

[http://uk.php.net/manual/en/function.urlencode.php](http://uk.php.net/manual/en/function.urlencode.php)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 22, 2003, 7:13pm UTC](https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396/4 "2003-12-22T19:13:16Z")

</div>

that’s it! thanks! :te:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 23, 2003, 8:12pm UTC](https://forum.kirupa.com/t/converting-string-to-ascii-or-similar/38396/5 "2003-12-23T20:12:31Z")

</div>

You’re welcome, Kalliban. 😉
