URL Encoding: Reading special characters from a text file
One common technique used to load variables in Macromedia Flash is reading the data from a text file on the server or CD. This works well in most situations. However, there are certain characters that cannot be read directly from text.
Entering these characters in a text file read by Macromedia Flash may cause unusual results. These characters need to be URL encoded. URL encoding replaces the alphanumeric character with the hexadecimal combination which represents that character.
Note: Macromedia Flash MX adds full Unicode support to the Macromedia Flash Player. This may be helpful in encoding your data. For complete details see Working with Multiple Languages in the Macromedia Flash Support Center.
Use encoding to ensure that variables are passed correctly
The example below illustrates how special characters can be retained using URL encoding:
A text file containing the following variable value will read into Flash as ‘Cost= 85’, dropping the + character:
Cost=+85
However, using URL encoding to replace the + character the original text will result in Flash displaying ‘Cost= +85’ correctly:
Cost=%2b85
Use this URL Encoding table for special characters:
Character | Code | Character | Code |
---|---|---|---|
© | %26%23169; | t | %74 |
® | %26%23174; | u | %75 |
™ | %E2%84%A2 | v | %76 |
backspace | %08 | w | %77 |
tab | %09 | x | %78 |
linefeed | %0A | y | %79 |
creturn | %0D | z | %7A |
space | %20 | { | %7B |
! | %21 | | | %7C |
“ | %22 | } | %7D |
# | %23 | ~ | %7E |
$ | %24 | ¢ | %A2 |
% | %25 | £ | %A3 |
& | %26 | ¥ | %A5 |
‘ | %27 | | | %A6 |
( | %28 | § | %A7 |
) | %29 | « | %AB |
* | %2A | ¬ | %AC |
+ | %2B | ¯ | %AD |
, | %2C | º | %B0 |
– | %2D | ± | %B1 |
. | %2E | ª | %B2 |
/ | %2F | , | %B4 |
0 | %30 | µ | %B5 |
1 | %31 | » | %BB |
2 | %32 | ¼ | %BC |
3 | %33 | ½ | %BD |
4 | %34 | ¿ | %BF |
5 | %35 | A` | %C0 |
6 | %36 | A´ | %C1 |
7 | %37 | A^ | %C2 |
8 | %38 | A~ | %C3 |
9 | %39 | A¨ | %C4 |
: | %3A | A° | %C5 |
; | %3B | Æ | %C6 |
< | %3C | C¸ | %C7 |
= | %3D | E` | %C8 |
> | %3E | E´ | %C9 |
? | %3F | E^ | %CA |
@ | %40 | E¨ | %CB |
A | %41 | I` | %CC |
B | %42 | I´ | %CD |
C | %43 | I^ | %CE |
D | %44 | I¨ | %CF |
E | %45 | Ð | %D0 |
F | %46 | N~ | %D1 |
G | %47 | O` | %D2 |
H | %48 | O´ | %D3 |
I | %49 | O^ | %D4 |
J | %4A | O~ | %D5 |
K | %4B | O¨ | %D6 |
L | %4C | Ø | %D8 |
M | %4D | U` | %D9 |
N | %4E | U´ | %DA |
O | %4F | U^ | %DB |
P | %50 | U¨ | %DC |
Q | %51 | Y´ | %DD |
R | %52 | Þ | %DE |
S | %53 | ß | %DF |
T | %54 | a` | %E0 |
U | %55 | a´ | %E1 |
V | %56 | a^ | %E2 |
W | %57 | a~ | %E3 |
X | %58 | a¨ | %E4 |
Y | %59 | a° | %E5 |
Z | %5A | æ | %E6 |
[ | %5B | c¸ | %E7 |
\ | %5C | e` | %E8 |
] | %5D | e´ | %E9 |
^ | %5E | e^ | %EA |
_ | %5F | e¨ | %EB |
` | %60 | i` | %EC |
a | %61 | i´ | %ED |
b | %62 | i^ | %EE |
c | %63 | i¨ | %EF |
d | %64 | ð | %F0 |
e | %65 | n~ | %F1 |
f | %66 | o` | %F2 |
g | %67 | o´ | %F3 |
h | %68 | o^ | %F4 |
i | %69 | o~ | %F5 |
j | %6A | o¨ | %F6 |
k | %6B | ÷ | %F7 |
l | %6C | ø | %F8 |
m | %6D | u` | %F9 |
n | %6E | u´ | %FA |
o | %6F | u^ | %FB |
p | %70 | u¨ | %FC |
q | %71 | y´ | %FD |
r | %72 | þ | %FE |
s | %73 | y¨ | %FF |
ADDITIONAL INFORMATION
The TAB character (URL encoded with %09) is not supported in Flash or HTML. In Flash and HTML, the TAB key is reserved for switching focus between form fields.
- More information on URL encoding can be found at www.blooberry.com/indexdot/html/topics/urlencoding.htm.
- You may also find these third-party tools useful:
Wow, wonderful blog structure! How long have you ever been running a blog for? you make running a blog look easy. The entire glance of your website is excellent, let alone the content!