39
1 UNICODE Semistrukturierte Daten 1 Gruppe 8

1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

Embed Size (px)

Citation preview

Page 1: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

1

UNICODE

Semistrukturierte Daten 1

Gruppe 8

Page 2: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

2

Inhalt

• Motivation• History – Birth of Unicode• Die Organisation• Anwendungsgebiete• Technische Sichtweise / Charactersets• Fonts / Kodierungskriterien• Unicode in HTML / XML• Links & Resources / Q & A

Page 3: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

3

Motivation

• Problem: andere Länder – andere Schriften…• Ziel: alle weltweit bekannten Textzeichen in einem

Zeichensatz zusammenzufassen • Anzahl riesig (allein >9000 chinesische Zeichen)

• Gesucht: innovative Lösung um alles unter einen Hut zu kriegen

Page 4: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

4

Was wird nun codiert?

• Zeilenende

• Absatzende

• Schreibrichtung (nach rechts / links)

• 94.140 Zeichen (auf mehreren Ebenen)

• ABER: Darstellung nicht durch jeden Font möglich – meist kostenpflichtig

Page 5: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

5

Was ist Unicode

• Internationaler Standard• Zeichensatz

eine eindeutige Nummer für jedes Zeichen• Unicode ist:

– Plattformunabhängig– Programm/Programmiersprachen unabhängig– Sprachenunabhängig

• Erste vereinheitlichende Codierung, die ALLE Zeichen darstellen konnte• Durch zentrales gemeinnütziges Konsortium entwickelt und geregelt• Einsatzbereich, vor allem für Programme die:

– auf mehreren Plattformen laufen– in mehreren Sprachen laufen– ohne großen Aufwand verschiedenste Sprachen implementieren

• Aktuellste Version: 4.1.0• Unicode ist KEIN Font

Page 6: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

6

History – Birth of Unicode V 1.0

1986 • Xerox works on an idea to merge Japanese and Chinese characters more easily• Apple works out a theory to come up with a universal character set for the Apple File

Exchange development

1987• Unicode's original "begin at 0 and add the next character" architecture is created • Xerox begins discussing multilingual issues, new character encoding is a major topic, fixed-

width design is preferable.• Earliest documented use of the term "Unicode”

1988• Apple advances the idea about fixed-width 16 bit characters• First presentation of the Unicode principles in Dallas

Page 7: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

7

History – Birth of Unicode V 1.0

1989• Meetings joined by Sun, then Adobe, Claris, HP, NeXT and Pacific Rim Connections (later

morphed into Unicode Technical Committee)• Decision to incorporate all composite characters in existing ISO registered standards and to

guarantee round trip conversion to existing standards.• Decision to use logical ordering for bidirectional (Middle Eastern) and Indic text. • ANSI proposes a compromised Han Unification and use of C0, C1 to ISO. Apple, Claris,

Metaphor, NeXT, and Sun participate on behalf of Unicode. As a result of this compromise, the Unicode working group decides to use existing ISO orderings for script subsets, and use the ISO naming schemes.

• Unicode is presented to Microsoft , IBM, Unix, ISO SC2, WG2

1990• Microsoft shows interest in Unicode, also Apple Japan, Microsoft KK, IBM becomes active• First implementation of a WYSIWYG prototype for demonstration• Final review draft of Unicode is distributed internationally• Decision to use logical ordering for all South Asian scripts, add length marks

Page 8: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

8

History – Birth of Unicode V 1.0

1991• Creation of the Unicode Technical Committee (UTC) • first articles about Unicode appears in the New York Times• Novell joins• first unofficial 2-day Unicode Workshop a success• first Unicode book appears finally

1992• The Unicode Standard Version 1.0, Volume 2 is printed.• Article "Kiss your ASCII Goodbye" appears in PC Magazine.

Page 9: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

9

Die Organisation

• Unicode durch zentrales Konsortium geregelt

• Non-Profit Organisation

• Zusammenarbeit mit W3C und ISO

• Zuständig für Zeichensatz ISO/IEC 10646

• Ziel: Entwicklung und Erweiterung

• Mitglieder aus allen Global Playern der IT-Wirtschaft(IBM, Microsoft, Apple, Cisco, Oracle, …)

• Zu finden unter: www.unicode.org

Page 10: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

10

Die Organisation

Ursprüngliche Vorstandsmitglieder von Unicode Inc:• Larry Tesler, Vice President Advanced Products,   Apple Computer, Inc. • Robert Carr, Vice President Software Development, GO Corporation • Richard Holleman, Director of Telecommunications, IBM Corporation • Charles Irby, Vice President of Development,  Metaphor Computer Systems • Paul Maritz, Vice President Advanced Operating Systems,  Microsoft Corporation • Bud Tribble, Vice President Software Engineering, NeXT Computer Inc. • Jay Israel, Vice President Advanced Technology, Novell, Inc. • David Richards, Director of Development, The Research Libraries Group. • John Gage, Vice President Desktop Development, Sun Microsystems Inc.

Geschäftsführer bzw. Gründungsmiglieder: • Mark Davis, President

• Mike Kernaghan, Vice-President

• Joe Becker, Technical Vice-President • Ken Whistler, Secretary • Bill English, Treasurer

Page 11: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

11

Anwendungsgebiete (1)

Datenbanken• Adabas• Caché and Ensemble • FrontBase • IBM • Ingres • Justsystem Goro• Microsoft Access,• SQL Server• Mimer SQL

•NCR Teradata•Onix •Oracle 8•PostgreSQL•Progress Software •Qwikly•Sybase •Unisys UREP

Page 12: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

12

Anwendungsgebiete (2)

Betriebssysteme• Apple Mac OS 9.2, Mac OS X 10.1, Mac OS X Server,

ATSUI• Compaq's Tru64 UNIX, Open VMS• GNU/Linux with glibc 2.2.2 or newer - FAQ support• IBM AIX, AS/400, OS/2• Inferno by Vita Nuova• Microsoft Windows CE, NT, 2000, XP• SCO UnixWare 7.1.0• Sun Solaris• Symbian Platform

Page 13: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

13

Anwendungsgebiete (3)

Standards• XML• XHTML• XSL• LDAP• CORBA 3.0• WAP (WML)• …

Suchmaschinen• Alta Vista• Yahoo • Google• Fastsearch

Page 14: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

14

Anwendungsgebiete (4)

Programmiersprachen, Entwicklungsumgebungen Ada 95CLISP Common LispG2 5.0 Rev. 0 by Gensym Corporation, GAWK 3.0.3JavaJavaScript (ECMAScript)Led C++ class libraryMicrosoft VJ++Visual Studio 7.0 (forthcoming)Visual BasicPerlPython XML Spy 3.0 from Icon Information-Systems GmbH

Page 15: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

15

Technische Sichtweise

• UTF (Unicode Transformation Format)– Spezifiziert zu jedem Zeichen eine eindeutige Byte Sequenz

• Verschiedene Standards:– UTF 8: Hauptsächlich WEB– UTF 16: Hauptsächlich Java und Windows– UTF 32: Hauptsächlich UNIX– UTF 7: E-Mail – ohne MIME (Vollständigkeitshalber)– UTF-EBCDIC: Mainframe (Vollständigkeitshalber)

• Konvertierungen zwischen UTF 8 / 16 / 32:– Verlustfrei– Schnell– Algorithmische Konvertierung

Page 16: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

16

Technische SichtweiseUTF-8

• ASCII compatible– characters in the range U+0000→U+007F can be encoded

as a single byte.

• Ken Thompson had turned AT&T Bell Lab’s Plan 9 into the world’s first operating system to use UTF-8

• Default encoding for xml

Page 17: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

17

Technische Sichtweise

UTF 8 / 16 / 32 (1)

UTF 8 UTF 16 UTF 32

Größe 8 bit 16 bit 32 bit

min. Bytes/Zeichen

1 2 3

max. Bytes/Zeichen

4 4 4

Bsp 1: 1 UTF16 Zeichen kann als 2 UTF8 dargestellt werdenBsp 2: 1 UTF32 2 UTF16 4 UTF8 Zeichen

Page 18: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

18

UTF 8 UTF 16 UTF 32

Beispiel für Zeichen in den jeweiligen Kodierungen:

Zeichen UTF 8 UTF 16 UTF 32

„e“ U+65 U+0065 U+0000 0065

„$“ U+24 U+0024 U+0000 0024

Hah (Arabic) U+DA 85 U+0685 U+0000 0685

yi (Xip) U+EA 91 A0 U+A460 U+0000 A460

Page 19: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

19

Technische Sichtweise

UTF 8 / 16 / 32 (2)

Besonderheiten / Unterschiede UTF 16 und UTF32:• UTF16/32 BE: Big Endian: MSB (most significant bit first)

• UTF16/32 LE: Little Endian: LSB (least significant bit first)

• UTF16/32: std: MSB, oder BOM (byte order mark)

Bytes Encoding

FF FE 00 00 UTF32 LE

00 00 FE FF UTF32 BE

FF FE UTF16 LE

FE FF UTF16 BE

Page 20: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

20

Technische Sichtweise

Schriften

Unicode definiert nicht Sprachen – sondern Schriften

Grund: Viele Sprachen haben gleiche Zeichen – diese können vereinheitlicht werden

In der Letzten Version 4.1.0 werden folgende Schriften unterstützt:

Page 21: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

21

Character Sets

Schriften

Page 22: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

22

Character Sets

Sonderzeichen

Page 23: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

23

Character Sets – Ranges (1)

• U+0000* – U+007F* Controls and Basic Latin (~ASCII):

• U+0080* – U+00FF* Controls and Latin-1

* Utf16

Page 24: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

24

Character Sets – Ranges (2)U+0600* – U+06FF* Arabic

U+0685* Hah U+06B4* Gaf U+069C* SeenAusrichtung: Right to Left *

Utf16

Page 25: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

25

Character Sets – Ranges (3)

U+0F00* – U+0FFF* Tibetan

U+0F47* Ja U+0F5C* Dzha U+0F43* GhaAusrichtung: Left to Right * Utf16

Page 26: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

26

Fonts

Grundsätzlich:• Font bildet eine Byte Sequence auf ein Bildzeichen ab

Unicode Font:• Byte Sequenzen des jeweiligen Unicode Typs sind als

Abbildungen auf Bildzeichen verfügbar

Bsp: Arial Unicode MS: ab MS Office 2002 inkludiert, 38.917 Zeichen, 50377 Bildzeichen

Page 27: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

27

Fonts

in Java

Unicode Fonts in Java:

1. Kopieren der font-files in das Java-Font Verzeichnis: jre/lib/fonts

2. font.properties Datei anpassen bzw. neu erstellen(wenn ein mapping zwischen logischen und physischem Font oder eine Lokalisierung benötigt wird)zB: font.properties.ko (für koreanisch)zB: serif.0=Arial,ANSI_CHARSET (für Mapping auf Arial)zB: serif.1=WingDings,SYMBOL_CHARSET,NEED_CONVERTED

fontcharset.serif.1=sun.awt.windows.CharToByteWingDings

3. Javacode Example: new Font(„serif", Font.PLAIN, 12)

Page 28: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

28

Eingabemethoden

• Eingabe chinesischer Zeichen– Grundsätzlich über jede Tastatur möglich

– Aufgrund der vielen Zeichen: Tastenkombinationen• die meistgebrauchten Zeichen = 1 Taste

• Alle weiteren Zeichen = Tastenkombination (<1%)

Page 29: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

29

Kodierungskriterien

Stetigkeit von kodierten Zeichen:

• Vor Normierung äußerst sorgfältige Prüfungen• Einmal kodierte Zeichen dürfen nicht mehr entfernt

werden• Somit Gewährleistung der Langlebigkeit digitaler

Daten • BMB (Basic Multilingual Plane) vs. Astral Plane

Page 30: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

30

Kodierungskriterien

Unicode kodiert abstrakten Zeichen

(Idee eines Buchstaben) –

keine Glyphen

(konkrete grafische Darstellung)

Ermöglichung von Glyphenvarianten: • 256 Variation Selectors• werden ggf. dem Code nachgestellt

Page 31: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

31

Unicode in HTML

Definition von Encoding in HTML durch Meta-Angabe:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

Allerdings: Auto-Detection durch Browser (Byte Order Mark), sollte zumindest bis zur Meta-Angabe möglich sein

Page 32: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

32

Unicode in XML

• XML:<?xml version="1.0" encoding="UTF-8"?>

• Default-Encoding: Unicode über Byte Order Mark

• Wenn kein BOM, dann UTF-8

• XML-Prozessoren müssen UTF-8 und UTF-16 unterstützen

Page 33: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

33

Unicode in HTML/XML

Numerische Character Referenz:

• Dezimal: &#160;

• Hexadezimal: &#x00A0;

Dokument muss nicht in einem Unicode-Format gespeichert werden, kann aber trotzdem numerische Referenzen auf Codepoints enthalten!

Page 34: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

34

Unicode und XML

• Text: Serie von Characters (Daten und Markup)

• Character: Atomare Texteinheit

• Erlaubte Character Range:#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF](ohne surrogate blocks, FFFE und FFFF)

Page 35: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

35

Unicode und XML

Aber: Namen sind Subsets von Markup und Text

NameChar   ::=   Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender

Name   ::=   (Letter | '_' | ':') (Namechar)*

Wobei: Letters nicht nur A-Z!

Page 36: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

36

Unicode in XML

Manche Characters nicht für XML geeignet

• Im Unicode Standard veraltet

• Problematisch ohne zusätzliche Daten

• Funktionalität durch Markup sinnvoller

• Kollidieren mit Markup

Page 37: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

37

Unicode in XML

Beispiele

• Problem: Überlagerung von Control Codes und XML-Markupz.B.: Line and paragraph separator Codepoint: U+2028 .. U+2029Lösung: <xhtml:br />, <xhtml:p></xhtml:p> oder entsprechende

• Weiters: Widersprüche zwischen Control Codes und Markup möglich. Frage nach Prioritätz.B.: Sprachidentifikation Codepoint: U+E0000 .. U+E007F Lösung: xhtml:lang oder xml:lang

Page 38: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

38

Links and Ressources

• Unicode Organisation Homepage:– http://www.unicode.org

• Unicode General Information:– http://de.wikipedia.org/wiki/Unicode

• Unicode Characters:– http://www.decodeunicode.org/

• Filecodierungsinformationen:– http://www.fileformat.info/info/unicode/char/search.htm

• XML 1.0 (3rd Ed) W3C Recommendation– http://www.w3.org/TR/REC-xml/

Page 39: 1 UNICODE Semistrukturierte Daten 1 Gruppe 8. 2 Inhalt Motivation History – Birth of Unicode Die Organisation Anwendungsgebiete Technische Sichtweise

39

Questions & Answers

Fragen zu Unicode bitte jetzt stellen