Unicodetabelle Hier ein kleines Skript, um eine Tabelle von Unicode-Zeichen anzeigen zu lassen.

   1 #!/usr/bin/python
   2 # -*- coding: UTF-8 -*-
   3 
   4 import sys, unicodedata
   5 
   6 stdout_encoding = sys.stdout.encoding or sys.getfilesystemencoding()
   7 print "stdout encoding:", stdout_encoding
   8 
   9 #
  10 # Es gibt noch jede Menge andere interessanter Blöcke!
  11 # Die Adressen und Namen der Blöcke können unter folgender Adresse nachgesehen werden:
  12 #
  13 # http://www.decodeunicode.org
  14 #
  15 #~ block = (0x0000, 0x007F) # Basic Latin
  16 block = (0x0080, 0x00FF) # Latin-1 Supplement
  17 #~ block = (0x2500, 0x257f) # Box Drawing
  18 #~ block = (0xFE30, 0xFE4F) # CJK Compatibility Forms
  19 
  20 
  21 for i in xrange(block[0], block[1]):
  22 
  23     hex_value = hex(i)[2:]
  24     char = unichr(i)
  25 
  26     try:
  27         print " >> %s <<" % char.encode(stdout_encoding),
  28     except UnicodeEncodeError:
  29         print " >> %s <<" % repr(char),
  30 
  31     # zum Einbinden in Python-Sourcecode z.B.: print u"\u256c"
  32     print "| \\u%s" % hex_value,
  33 
  34     try:
  35         print "| %s" % char.decode("String_Escape"),
  36     except:
  37         print "| \\x%s" % hex_value,
  38 
  39     # zum einbinden in HTML:
  40     print "| &amp;#%i;" % i,
  41 
  42     print "| %s" % unicodedata.name(char, "(no unicode name)")

Ausgabe des Blocks "Box Drawing" (unter Linux in der Konsole):

stdout encoding: UTF-8
 >> ─ << | \u2500 | \x2500 | &amp;#9472; | BOX DRAWINGS LIGHT HORIZONTAL
 >> ━ << | \u2501 | \x2501 | &amp;#9473; | BOX DRAWINGS HEAVY HORIZONTAL
 >> │ << | \u2502 | \x2502 | &amp;#9474; | BOX DRAWINGS LIGHT VERTICAL
 >> ┃ << | \u2503 | \x2503 | &amp;#9475; | BOX DRAWINGS HEAVY VERTICAL
 >> ┄ << | \u2504 | \x2504 | &amp;#9476; | BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL
 >> ┅ << | \u2505 | \x2505 | &amp;#9477; | BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL
 >> ┆ << | \u2506 | \x2506 | &amp;#9478; | BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL
 >> ┇ << | \u2507 | \x2507 | &amp;#9479; | BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL
 >> ┈ << | \u2508 | \x2508 | &amp;#9480; | BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL
 >> ┉ << | \u2509 | \x2509 | &amp;#9481; | BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL
 >> ┊ << | \u250a | \x250a | &amp;#9482; | BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL
 >> ┋ << | \u250b | \x250b | &amp;#9483; | BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL
 >> ┌ << | \u250c | \x250c | &amp;#9484; | BOX DRAWINGS LIGHT DOWN AND RIGHT
 >> ┍ << | \u250d | \x250d | &amp;#9485; | BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY
 >> ┎ << | \u250e | \x250e | &amp;#9486; | BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT
 >> ┏ << | \u250f | \x250f | &amp;#9487; | BOX DRAWINGS HEAVY DOWN AND RIGHT
 >> ┐ << | \u2510 | \x2510 | &amp;#9488; | BOX DRAWINGS LIGHT DOWN AND LEFT
 >> ┑ << | \u2511 | \x2511 | &amp;#9489; | BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY
 >> ┒ << | \u2512 | \x2512 | &amp;#9490; | BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT
 >> ┓ << | \u2513 | \x2513 | &amp;#9491; | BOX DRAWINGS HEAVY DOWN AND LEFT
 >> └ << | \u2514 | \x2514 | &amp;#9492; | BOX DRAWINGS LIGHT UP AND RIGHT
 >> ┕ << | \u2515 | \x2515 | &amp;#9493; | BOX DRAWINGS UP LIGHT AND RIGHT HEAVY
 >> ┖ << | \u2516 | \x2516 | &amp;#9494; | BOX DRAWINGS UP HEAVY AND RIGHT LIGHT
 >> ┗ << | \u2517 | \x2517 | &amp;#9495; | BOX DRAWINGS HEAVY UP AND RIGHT
 >> ┘ << | \u2518 | \x2518 | &amp;#9496; | BOX DRAWINGS LIGHT UP AND LEFT
 >> ┙ << | \u2519 | \x2519 | &amp;#9497; | BOX DRAWINGS UP LIGHT AND LEFT HEAVY
 >> ┚ << | \u251a | \x251a | &amp;#9498; | BOX DRAWINGS UP HEAVY AND LEFT LIGHT
 >> ┛ << | \u251b | \x251b | &amp;#9499; | BOX DRAWINGS HEAVY UP AND LEFT
 >> ├ << | \u251c | \x251c | &amp;#9500; | BOX DRAWINGS LIGHT VERTICAL AND RIGHT
 >> ┝ << | \u251d | \x251d | &amp;#9501; | BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
 >> ┞ << | \u251e | \x251e | &amp;#9502; | BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT
 >> ┟ << | \u251f | \x251f | &amp;#9503; | BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT
 >> ┠ << | \u2520 | \x2520 | &amp;#9504; | BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
 >> ┡ << | \u2521 | \x2521 | &amp;#9505; | BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY
 >> ┢ << | \u2522 | \x2522 | &amp;#9506; | BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY
 >> ┣ << | \u2523 | \x2523 | &amp;#9507; | BOX DRAWINGS HEAVY VERTICAL AND RIGHT
 >> ┤ << | \u2524 | \x2524 | &amp;#9508; | BOX DRAWINGS LIGHT VERTICAL AND LEFT
 >> ┥ << | \u2525 | \x2525 | &amp;#9509; | BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
 >> ┦ << | \u2526 | \x2526 | &amp;#9510; | BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT
 >> ┧ << | \u2527 | \x2527 | &amp;#9511; | BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT
 >> ┨ << | \u2528 | \x2528 | &amp;#9512; | BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
 >> ┩ << | \u2529 | \x2529 | &amp;#9513; | BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY
 >> ┪ << | \u252a | \x252a | &amp;#9514; | BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY
 >> ┫ << | \u252b | \x252b | &amp;#9515; | BOX DRAWINGS HEAVY VERTICAL AND LEFT
 >> ┬ << | \u252c | \x252c | &amp;#9516; | BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
 >> ┭ << | \u252d | \x252d | &amp;#9517; | BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT
 >> ┮ << | \u252e | \x252e | &amp;#9518; | BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT
 >> ┯ << | \u252f | \x252f | &amp;#9519; | BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
 >> ┰ << | \u2530 | \x2530 | &amp;#9520; | BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
 >> ┱ << | \u2531 | \x2531 | &amp;#9521; | BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY
 >> ┲ << | \u2532 | \x2532 | &amp;#9522; | BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY
 >> ┳ << | \u2533 | \x2533 | &amp;#9523; | BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
 >> ┴ << | \u2534 | \x2534 | &amp;#9524; | BOX DRAWINGS LIGHT UP AND HORIZONTAL
 >> ┵ << | \u2535 | \x2535 | &amp;#9525; | BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT
 >> ┶ << | \u2536 | \x2536 | &amp;#9526; | BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT
 >> ┷ << | \u2537 | \x2537 | &amp;#9527; | BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
 >> ┸ << | \u2538 | \x2538 | &amp;#9528; | BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
 >> ┹ << | \u2539 | \x2539 | &amp;#9529; | BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY
 >> ┺ << | \u253a | \x253a | &amp;#9530; | BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY
 >> ┻ << | \u253b | \x253b | &amp;#9531; | BOX DRAWINGS HEAVY UP AND HORIZONTAL
 >> ┼ << | \u253c | \x253c | &amp;#9532; | BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
 >> ┽ << | \u253d | \x253d | &amp;#9533; | BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT
 >> ┾ << | \u253e | \x253e | &amp;#9534; | BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT
 >> ┿ << | \u253f | \x253f | &amp;#9535; | BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY
 >> ╀ << | \u2540 | \x2540 | &amp;#9536; | BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT
 >> ╁ << | \u2541 | \x2541 | &amp;#9537; | BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT
 >> ╂ << | \u2542 | \x2542 | &amp;#9538; | BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
 >> ╃ << | \u2543 | \x2543 | &amp;#9539; | BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT
 >> ╄ << | \u2544 | \x2544 | &amp;#9540; | BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT
 >> ╅ << | \u2545 | \x2545 | &amp;#9541; | BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT
 >> ╆ << | \u2546 | \x2546 | &amp;#9542; | BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT
 >> ╇ << | \u2547 | \x2547 | &amp;#9543; | BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY
 >> ╈ << | \u2548 | \x2548 | &amp;#9544; | BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY
 >> ╉ << | \u2549 | \x2549 | &amp;#9545; | BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY
 >> ╊ << | \u254a | \x254a | &amp;#9546; | BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY
 >> ╋ << | \u254b | \x254b | &amp;#9547; | BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
 >> ╌ << | \u254c | \x254c | &amp;#9548; | BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL
 >> ╍ << | \u254d | \x254d | &amp;#9549; | BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL
 >> ╎ << | \u254e | \x254e | &amp;#9550; | BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL
 >> ╏ << | \u254f | \x254f | &amp;#9551; | BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL
 >> ═ << | \u2550 | \x2550 | &amp;#9552; | BOX DRAWINGS DOUBLE HORIZONTAL
 >> ║ << | \u2551 | \x2551 | &amp;#9553; | BOX DRAWINGS DOUBLE VERTICAL
 >> ╒ << | \u2552 | \x2552 | &amp;#9554; | BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
 >> ╓ << | \u2553 | \x2553 | &amp;#9555; | BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
 >> ╔ << | \u2554 | \x2554 | &amp;#9556; | BOX DRAWINGS DOUBLE DOWN AND RIGHT
 >> ╕ << | \u2555 | \x2555 | &amp;#9557; | BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
 >> ╖ << | \u2556 | \x2556 | &amp;#9558; | BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
 >> ╗ << | \u2557 | \x2557 | &amp;#9559; | BOX DRAWINGS DOUBLE DOWN AND LEFT
 >> ╘ << | \u2558 | \x2558 | &amp;#9560; | BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
 >> ╙ << | \u2559 | \x2559 | &amp;#9561; | BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
 >> ╚ << | \u255a | \x255a | &amp;#9562; | BOX DRAWINGS DOUBLE UP AND RIGHT
 >> ╛ << | \u255b | \x255b | &amp;#9563; | BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
 >> ╜ << | \u255c | \x255c | &amp;#9564; | BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
 >> ╝ << | \u255d | \x255d | &amp;#9565; | BOX DRAWINGS DOUBLE UP AND LEFT
 >> ╞ << | \u255e | \x255e | &amp;#9566; | BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
 >> ╟ << | \u255f | \x255f | &amp;#9567; | BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
 >> ╠ << | \u2560 | \x2560 | &amp;#9568; | BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
 >> ╡ << | \u2561 | \x2561 | &amp;#9569; | BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
 >> ╢ << | \u2562 | \x2562 | &amp;#9570; | BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
 >> ╣ << | \u2563 | \x2563 | &amp;#9571; | BOX DRAWINGS DOUBLE VERTICAL AND LEFT
 >> ╤ << | \u2564 | \x2564 | &amp;#9572; | BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
 >> ╥ << | \u2565 | \x2565 | &amp;#9573; | BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
 >> ╦ << | \u2566 | \x2566 | &amp;#9574; | BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
 >> ╧ << | \u2567 | \x2567 | &amp;#9575; | BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
 >> ╨ << | \u2568 | \x2568 | &amp;#9576; | BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
 >> ╩ << | \u2569 | \x2569 | &amp;#9577; | BOX DRAWINGS DOUBLE UP AND HORIZONTAL
 >> ╪ << | \u256a | \x256a | &amp;#9578; | BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
 >> ╫ << | \u256b | \x256b | &amp;#9579; | BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
 >> ╬ << | \u256c | \x256c | &amp;#9580; | BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
 >> ╭ << | \u256d | \x256d | &amp;#9581; | BOX DRAWINGS LIGHT ARC DOWN AND RIGHT
 >> ╮ << | \u256e | \x256e | &amp;#9582; | BOX DRAWINGS LIGHT ARC DOWN AND LEFT
 >> ╯ << | \u256f | \x256f | &amp;#9583; | BOX DRAWINGS LIGHT ARC UP AND LEFT
 >> ╰ << | \u2570 | \x2570 | &amp;#9584; | BOX DRAWINGS LIGHT ARC UP AND RIGHT
 >> ╱ << | \u2571 | \x2571 | &amp;#9585; | BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
 >> ╲ << | \u2572 | \x2572 | &amp;#9586; | BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
 >> ╳ << | \u2573 | \x2573 | &amp;#9587; | BOX DRAWINGS LIGHT DIAGONAL CROSS
 >> ╴ << | \u2574 | \x2574 | &amp;#9588; | BOX DRAWINGS LIGHT LEFT
 >> ╵ << | \u2575 | \x2575 | &amp;#9589; | BOX DRAWINGS LIGHT UP
 >> ╶ << | \u2576 | \x2576 | &amp;#9590; | BOX DRAWINGS LIGHT RIGHT
 >> ╷ << | \u2577 | \x2577 | &amp;#9591; | BOX DRAWINGS LIGHT DOWN
 >> ╸ << | \u2578 | \x2578 | &amp;#9592; | BOX DRAWINGS HEAVY LEFT
 >> ╹ << | \u2579 | \x2579 | &amp;#9593; | BOX DRAWINGS HEAVY UP
 >> ╺ << | \u257a | \x257a | &amp;#9594; | BOX DRAWINGS HEAVY RIGHT
 >> ╻ << | \u257b | \x257b | &amp;#9595; | BOX DRAWINGS HEAVY DOWN
 >> ╼ << | \u257c | \x257c | &amp;#9596; | BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT
 >> ╽ << | \u257d | \x257d | &amp;#9597; | BOX DRAWINGS LIGHT UP AND HEAVY DOWN
 >> ╾ << | \u257e | \x257e | &amp;#9598; | BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT

Mit den Angaben in der zweiten Spalte kann man für ein eigenes Programm unicode Zeichen einfügen. z.B. für das Zeichen "?":

   1 print u"\u256c"

Die Angabe in der vierten Spalte (z.B. ╬) kann man nutzen, wenn man das Zeichen in HTML einbinden möchte.

Tags: Codesnippets | Unicode | String | Html

Unicodetabelle (zuletzt geändert am 2009-06-17 16:14:14 durch anonym)