Keyboard Characters/Symbols to ASCII Codes

convert characters to ascii code

I had a situation where some of my characters where not showing properly when opening in a web browser so I started using ASCII codes to replace some symbols such as spaces, double quotes, single quotes, etc. This was also a problem when building url links which contains character such as +, spaces, etc.

Below is a list of ASCII codes that might come in handy for both HTML pages and URL parameters:

The ASCII column will indicate a number which will need a prefix of &# and a postfix of ;

Example:

Symbol: Space 

ASCII Code: &# 32 ;      ( No Spaces IMPORTANT – I could not have used the right codes since they would have been converted to chars/symbols in HTML)

Feel free to leave comments of more ASCII Codes :

ASCII Char ASCII Code  URL- encoding ASCII Char ASCII Code  URL- encoding ASCII Char ASCII Code URL- encoding
Space 32  %20 @ 64  %40 ` 96  %60
! 33  %21 A 65  %41 a 97  %61
34  %22 B 66  %42 b 98  %62
# 35  %23 C 67  %43 c 99  %63
$ 36  %24 D 68  %44 d 100  %64
% 37  %25 E 69  %45 e 101  %65
& 38  %26 F 70  %46 f 102  %66
 ‘ 39  %27 G 71  %47 g 103  %67
( 40  %28 H 72  %48 h 104  %68
) 41  %29 I 73  %49 i 105  %69
* 42  %2A J 74  %4A j 106  %6A
+ 43  %2B K 75  %4B k 107  %6B
, 44  %2C L 76  %4C l 108  %6C
45  %2D M 77  %4D m 109  %6D
. 46  %2E N 78  %4E n 110  %6E
/ 47 %2F O 79  %4F o 111  %6F
0 48 30% P 80  %50 p 112  %70
1 49  %31 Q 81  %51 q 113  %71
2 50  %32 R 82  %52 r 114  %72
3 51  %33 S 83  %53 s 115  %73
4 52  %34 T 84  %54 t 116  %74
5 53  %35 U 85  %55 u 117  %75
6 54  %36 V 86  %56 v 118  %76
7 55  %37 W 87  %57 w 119  %77
8 56  %38 X 88  %58 x 120  %78
9 57  %39 Y 89  %59 y 121  %79
: 58  %3A Z 90  %5A z 122  %7A
; 59  %3B [ 91  %5B { 123  %7B
< 60  %3C \ 92  %5C | 124  %7C
= 61  %3D ] 93  %5D } 125  %7D
> 62  %3E ^ 94  %5E ~ 126  %7E
? 63  %3F _ 95  %5F  ©  %A9

)

Clearing Facebook Sharing URL or other Details

facebook-share-button

Recently I needed to create a SHARE on Facebook icon to share the URL of my page. Now, facebook uses og:title, og:image, etc meta tags to extract information out of the given URL and generate the share text for the URL. I needed to change the og:title, which is practically the title that comes up when sharing the page. The problem was that Facebook must have cached my URL, and no matter how many times I changed my og:title tag, the old title was being displayed. So this is what I needed to do to tell google to go through my website again in order to enforce and simulate reset cache.

Step 1:

Visit Facebook Developers Debug Tool

Step 2:

Enter the URL you need to reset cache in the text area as shown below:

facebook-debug-tool

Step 3:

So by now, step 2 should have done the reset cache job by now. However if you would like to verify and see how Facebook is seeing you site, at the bottom of the resulting page there is a URLs section with an option named “Scraped URL”  with a link “See exactly what our scraper sees for your URL”, click on that link and you will be presenter with the “view source” of your code as seen by Facebook.

Note: If you have red warnings/errors stating, you might want to fix that too while you’re at it, I know I did 😉