Use MySQL String Functions to Build Printable ASCII Character Chart
Printable ASCII Characters
ASCII stands for American Standard Code for Information Interchange. ASCII is the numerical representation of characters based on the English alphabet characters and non-printing characters. Table below lists the character encoding chart of 94 printable ASCII characters (excluding the space character), numbered from 33 to 126 in decimal base-10 number system.
Build the ASCII table by using MySQL string functions
To create a table like shown above, you only need to create a table in MySQL that stores the 94 printable characters. The you use five MySQL string functions (BIN, OCT, ASCII, HEX, SPACE) to convert the printable characters to their representations in the different number system.
Follow the steps below to build the ASCII table.
Step #1: Build a table to store the 94 printable characters
To copy and paste the query to SQLyog, use Firefox. Copying from Internet Explorer does not maintain the query format.
-- Build the table
Step #2: Bulk Insert the 94 printable characters
insert into `printable_char`(`id`,`single_char`)
Step #3: Create the query to retrieve the 94 printable characters and convert them to their other representations.
More detailed information about the five string functions (BIN, OCT, ASCII, HEX, SPACE) used in the query above, refer to MySQL String Functions section.
Copyright © 2013 GeeksEngine.com. All Rights Reserved.
This website is hosted by LunarPages.
No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it.