Accessibility

TechNote (Archived)

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.

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_14143

Products Affected:

flash