ASCII & Unicode Character Codes

Unicode is an industry-standard that was developed from the previous ASCII standard (which is now part of Unicode). Character encoding or character encoding is usually used in web development to display non-standard characters.

It is said that this code is used in HTML, C#, VBScript, VB.NET, PHP & JavaScript:

  • HTML using &#XXX
  • C# using Convert.ToChar(XXX)
  • VBScript, VB.NET dan PHP using chr(XXX) function.
  • JavaScript using String.fromCharCode(XXX)

Which XXX is the entity number

I more often use it in windows apps especially VB.NET and VB6 (for ASCII in the past). Which function is to check what keyboard keys are pressed to determine what code to run.

Examples are as follows:

VB6
Private Sub txtUserName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   txtPassword.SetFocus
End If
End Sub

VB.NET
Private Sub cboPaymentMedia_KeyPress(sender As Object,
            e As KeyPressEventArgsHandles cboPaymentMedia.KeyPress
    If Asc(e.KeyChar) = 13 Then
        txtPayment.Focus()
    End If
End Sub

I usually use this code to limit only numeric input and focus settings or trigger certain events when a key on the keyboard is pressed.

The most frequently used is keyascii 13 for enter. And make my own notes too, here are some keyascii that you can copy.

33!    71G    108l    145    182    219Û    
34"    72H    109m    146    183·    220Ü    
35#    73I    110n    147    184¸    221Ý    
36$    74J    111o    148    185¹    222Þ    
37%    75K    112p    149    186º    223ß    
38&    76L    113q    150    187»    224à    
39'    77M    114r    151    188¼    225á    
40(    78N    115s    152˜    189½    226â    
41)    79O    116t    153    190¾    227ã    
42*    80P    117u    154š    191¿    228ä    
43+    81Q    118v    155    192À    229å    
44,    82R    119w    156œ    193Á    230æ    
45-    83S    120x    157    194    231ç    
46.    84T    121y    158ž    195à   232è    
47/    85U    122z    159Ÿ    196Ä    233é    
480    86V    123{    160     197Å    234ê    
491    87W    124|    161¡    198Æ    235ë    
502    88X    125}    162¢    199Ç    236ì    
513    89Y    126~    163£    200È    237í    
524    90Z    
    164¤    201É    238î    
535    91[    128    165¥    202Ê    239ï    
546    92\    
    166¦    203Ë    240ð    
557    93]    130    167§    204Ì    241ñ    
568    94^    131ƒ    168¨    205Í    242ò    
579    95_    132    169©    206Π   243ó    
58:    96`    133    170ª    207Ï    244ô    
59;    97a    134    171«    208Р   245õ    
60<    98b    135    172¬    209Ñ    246ö    
61=    99c    136ˆ    173­    210Ò    247÷    
62>    100d    137    174®    211Ó    248ø    
63?    101e    138Š    175¯    212Ô    249ù    
64@    102f    139    176°    213Õ    250ú    
65A    103g    140Œ    177±    214Ö    251û    
66B    104h    141    178²    215×    252ü    
67C    105i    142Ž    179³    216Ø    253ý    
68D    106j    13enter    180´    217Ù    254þ    
69E    107k    8backspace    181µ    218Ú    255ÿ    
70F    



Post a Comment

1 Comments

Kalau penekanan 2 tombol gimana ka misal
CTRL+ENTER???

tipandtrickunikvb.blogspot.com