ASCII Chart

The ascii chart below displays the ascii code to use on your web sites for maximum compatibility. By using the proper ascii value rather than cut and paste, you can assure that your code will properly validate and even more importantly render correctly in all browsers. Updated to include Euro Symbol – #128.

CharacterHTMLAlternate HTMLExplanation
 � –  Unused
 	 Horizontal tab
 
 Line feed
  –  Unused
 
 Carriage Return
  –  Unused
Space  Space
!! Exclamation mark
"""Quotation mark
## Number sign
$$ Dollar sign
%% Percent sign
&&&Ampersand
'' Apostrophe
(( Left parenthesis
)) Right parenthesis
** Asterisk
++ Plus sign
,, Comma
-- Hyphen
.. Period (fullstop)
// Solidus (slash)
:: Colon
;&#59; Semi-colon
<&#60;&lt;Less than
=&#61; Equals sign
>&#62;&gt;Greater than
?&#63; Question mark
@&#64; Commercial at
[&#91; Left square bracket
\&#92; Reverse solidus (backslash)
]&#93; Right square bracket
^&#94; Caret
_&#95; Horizontal bar (underscore)
`&#96; Acute accent
{&#123; Left curly brace
|&#124; Vertical bar
}&#125; Right curly brace
~&#126; Tilde
 &#127; Unused
&#128; Euro Symbol
 &#129; Unused
&#130; Low single comma
quotation mark
ƒ&#131; Function sign
&#132; Low double comma
quotation mark
&#133; Ellipses
&#134; Dagger
&#135; Double dagger
ˆ&#136; Caret
&#137; Per mile sign
Š&#138; Capital S Hacek
&#139; Less-than sign
Œ&#140; Capital OE ligature
 &#141; – &#144; Unused
&#145; Single beginning
quotation mark
&#146; Single ending
quotation mark
&#147; Double beginning
quotation mark
&#148; Double ending quotation mark
&#149; Dot, middle
&#150; En dash
&#151; Em dash
˜&#152; Tilde
&#153; Trademark symbol
š&#154; Small s Hacek
&#155; Greater-than sign
œ&#156; Small oe ligature
 &#157; – &#158; Unused
Ÿ&#159; Capital Y,
diæresis / umlaut
 &#160;&nbsp;Non-breaking Space
¡&#161; Inverted exclamation
¢&#162; Cent sign
£&#163; Pound sterling
¤&#164; General currency sign
¥&#165; Yen sign
¦&#166; Broken vertical bar
§&#167; Section sign
¨&#168; Diæresis / Umlaut
©&#169; Copyright
ª&#170; Feminine ordinal
«&#171; Left angle quote,
guillemot left
¬&#172; Not sign
­&#173;&shy;Soft hyphen
®&#174; Registered trademark
¯&#175; Macron accent
°&#176; Degree sign
±&#177; Plus or minus
²&#178; Superscript two
³&#179; Superscript three
´&#180; Acute accent
µ&#181; Micro sign
&#182; Paragraph sign
·&#183; Middle dot
¸&#184; Cedilla
¹&#185; Superscript one
º&#186; Masculine ordinal
»&#187; Right angle quote,
guillemot right
¼&#188; Fraction one-fourth
½&#189; Fraction one-half
¾&#190; Fraction three-fourths
¿&#191; Inverted question mark
À&#192;&Agrave;Capital A, grave accent

Apache Custom Error Messages

Most of the users that come to your site, will not know what a “Internal Server Error” or “404” error is. They will not bother to check out the Apache manual either.

Custom error messages are not something to (just) show off with. In terms of (web-)usability, you are able to display a more friendlier or meaningful message to your users, and everyone will live happier ever after.

A lot of people still ask me how to add custom error pages to their website. Since some ISPs charge an arm and a leg to add them, here is how it is done – for free!

You log onto your shell and create a file called .htaccess in your document root. This can be achieved if you type “pico .htaccess”, “ee .htaccess” or “joe .htaccess” on the shell prompt. Let’s assume that you want to display a custom error page for “File not found”-errors (code: 404).

Put the following code inside the .htaccess:


ErrorDocument 404 /path/to/error/document.html


Save it. Viola! It’s all done.

You may also refer to a remote document:


ErrorDocument 404 http://errors.domain.com/404.php


The syntax is as follows:


ErrorDocument <3-digit-code> action


Can’t get enough of them?

Successful Client Requests
200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content
Client Request Redirected
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable (encoding)
407 Proxy Authentication Required
408 Request Timed Out
409 Conflicting Request
410 Gone
411 Content Length Required
412 Precondition Failed
413 Request Entity Too Long
414 Request URI Too Long
415 Unsupported Media Type
Server Errors
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported

Have fun!

Sorting database results

Databases offer a lot of flexibility when dealing with data. By spending some time upfront on the database design, it will save you plenty of headaches later on. Since the object of this to tutorial is not to elaborate on the advantages of using a database, I will skip to its limits.

The operations you can run on a database are always based on logic and numbers. So for example, when you run a store and sell T-Shirts, and you sort by size, “M” will always be sorted before “S”, even though it is not correct from a humanistic point of view.

Assuming we have a table called “Products” in the database, here is a set of data that you would typically deal with and a solution for sorting the data in a more useful way using the MySQL database.

Name    | Size

T-Shirt | L

T-Shirt | M

T-Shirt | S

T-Shirt | XL

T-Shirt | XS

And here is how you typically retrieve records:

SELECT Name, Size FROM Products ORDER BY Size

This query returns all products, however, not sorted “XS, S, M, L, XL” but in “L, M, S, XL, XS”.

The solution to this problem is a simple CASE (see: Control Flow Functions):

SELECT Name, Size,

CASE Size

WHEN XS THEN 1

WHEN S THEN 2

WHEN M THEN 3

WHEN L THEN 4

WHEN XL THEN 5

END

AS Sort_Order

FROM Products

ORDER BY Sort_Order ASC

This returns the products in order of their sizes. Use ASC (ascending) or DESC (descening) to change the order from smallest size to largest size or vice-versa.

That’s it, enjoy.

Pages: