bits - CS 580 Client-Server Programming Spring Semester,...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 580 Client-Server Programming Spring Semester, 2009 Doc 4 Interpreting Bits 2 Feb, 2010 Copyright ©, All rights reserved. 2010 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA. OpenContent ( http:// www.opencontent.org/opl.shtml ) license defines the copyright on this document.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Reference 2 The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!), Joel Spolsky, http:// www.joelonsoftware.com/articles/Unicode.html Wikipedia Java API docs Converting & Sending Sockets Data with a Leading Length Value, Tom Archer, http://www.codeguru.com/csharp/csharp/cs_network/sockets/article.php/c6827/
Background image of page 2
3 Characters
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What is a Character? 4 65 A 66 B 67 C Number (bits) Mapping from bits to an element in an alphabet 1001011 K
Background image of page 4
ASCII 5 A common mapping 1 - 32 map to control characters 33 - 127 map to characters in the American English alphabet with punctuation This is an example of a block encoding All characters are used by the same number of bits
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Variable-length coding (aside) 6 Use differing amounts of bits to encode characters Use few bits for frequently occurring characters Example: Huffman encoding Example: First MacWrite
Background image of page 6
7 Characters do not exist In files On the network
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 We apply the mapping to interpret contents of files as characters
Background image of page 8
ASCII and 128-255 9 On PCs people started used 128-255 for non-standard characters Used by non-english languages Mappings called: Code pages OEM Code pages 1-127 same as ASCII Code page 437 - Original IBM code page
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
To know what character it is 10 Need to know the bit pattern code page (the mapping)
Background image of page 10
Some DOS Code pages 11 437 — The original IBM PC code page 737 — Greek 775 — Estonian, Lithuanian and Latvian 850 — "Multilingual (Latin-1)" (Western European languages) 852 — "Slavic (Latin-2)" (Central and Eastern European languages) 855 — Cyrillic 857 — Turkish 858 — "Multilingual" with euro symbol 860 — Portuguese 861 — Icelandic 862 — Hebrew 863 — French Canadian 865 — Nordic 866 — Cyrillic 869 — Greek 65001 — UTF-8 Unicode Source http://en.wikipedia.org/wiki/Code_page. Yes the code pages were known by number and yes there were multiple code pages for the same language
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
OEM Pages 12 OEM pages supported by Windows http://msdn.microsoft.com/en-us/goglobal/bb964655.aspx Catalog of Character Sets and OEM pages http://www.i18nguy.com/unicode/codepages.html
Background image of page 12
Displaying Characters 13 а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я Cyrillic alphabet Text mode of VGA-compatible PC graphics hardware uses 8-bit code page Often done in graphics mode now Originally used bit maps for characters
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon