Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

encodings.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     encodings.h  -  Definition of macros, types etc. relative to character encodings.
00003                              -------------------
00004     begin                : October 31 2002
00005     copyright            : (C) 2003 by Vojtìch Toman
00006     email                : vtoman@lit.cz
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00026 #ifndef ENCODINGS_H
00027 #define ENCODINGS_H
00028 
00029 
00030 #include "defs.h"
00031 
00032 
00034 namespace Encodings
00035 {
00041   enum MIB
00042   {
00043     Unknown     =       -1,
00044     UTF_8       =       106,
00045     UTF_16      =       1015,
00046     US_ASCII    =       3,
00047     ISO_8859_1  =       4,
00048     ISO_8859_2  =       5,
00049     ISO_8859_3  =       6,
00050     ISO_8859_4  =       7,
00051     ISO_8859_5  =       8,
00052     ISO_8859_6  =       82,
00053     ISO_8859_7  =       10,
00054     ISO_8859_8  =       85,
00055     ISO_8859_9  =       12,
00056     ISO_8859_10 =       13,
00057     ISO_8859_11 =       2259,   //Thai - MIB taken from tis620 (which is byte by byte equivalent)
00058     ISO_8859_13 =       109,
00059     ISO_8859_14 =       110,
00060     ISO_8859_15 =       111,
00061     CP_1250     =       2250,
00062     CP_1251     =       2251,
00063     CP_1252     =       2252,
00064     CP_1253     =       2253,
00065     CP_1254     =       2254,
00066     CP_1255     =       2255,
00067     CP_1256     =       2256,
00068     CP_1257     =       2257,
00069     CP_1258     =       2258,
00070     KOI8_R      =       2084,
00071     KOI8_V      =       2088
00072   };
00073 
00074 
00075 
00081   struct EncodingName
00082   {
00084     const char *name;
00085 
00087     MIB mib;
00088   };
00089 }
00090 
00091 
00092 
00098 #define ENCODING_NAMES                                          \
00099 {"UTF-8", Encodings::UTF_8},                                    \
00100 {"UTF-16", Encodings::UTF_16},                                  \
00101 {"US-ASCII", Encodings::US_ASCII},                              \
00102 {"ISO-8859-1", Encodings::ISO_8859_1},                          \
00103 {"ISO-8859-2", Encodings::ISO_8859_2},                          \
00104 {"ISO-8859-3", Encodings::ISO_8859_3},                          \
00105 {"ISO-8859-4", Encodings::ISO_8859_4},                          \
00106 {"ISO-8859-5", Encodings::ISO_8859_5},                          \
00107 {"ISO-8859-6", Encodings::ISO_8859_6},                          \
00108 {"ISO-8859-7", Encodings::ISO_8859_7},                          \
00109 {"ISO-8859-8", Encodings::ISO_8859_8},                          \
00110 {"ISO-8859-9", Encodings::ISO_8859_9},                          \
00111 {"ISO-8859-10", Encodings::ISO_8859_10},                        \
00112 {"ISO-8859-11", Encodings::ISO_8859_11},                        \
00113 {"ISO-8859-13", Encodings::ISO_8859_13},                        \
00114 {"ISO-8859-14", Encodings::ISO_8859_14},                        \
00115 {"ISO-8859-15", Encodings::ISO_8859_15},                        \
00116 {"CP-1250", Encodings::CP_1250},                                \
00117 {"CP-1251", Encodings::CP_1251},                                \
00118 {"CP-1252", Encodings::CP_1252},                                \
00119 {"CP-1253", Encodings::CP_1253},                                \
00120 {"CP-1254", Encodings::CP_1254},                                \
00121 {"CP-1255", Encodings::CP_1255},                                \
00122 {"CP-1256", Encodings::CP_1256},                                \
00123 {"CP-1257", Encodings::CP_1257},                                \
00124 {"CP-1258", Encodings::CP_1258},                                \
00125 {"KOI8-R", Encodings::KOI8_R},                                  \
00126 {"KOI8-V", Encodings::KOI8_V},                                  \
00127 /* keep this item at the end of the list */                     \
00128 {0, Encodings::Unknown}
00129 
00130 
00131 
00137 #define LIST_ENCODINGS                                          \
00138 {                                                               \
00139   Encodings::EncodingName encodingNames[] = { ENCODING_NAMES }; \
00140   size_t i = 0;                                                 \
00141                                                                 \
00142   while (encodingNames[i].name && encodingNames[i+1].name)      \
00143     {                                                           \
00144       OUTPUT(encodingNames[i].name << ", ");                    \
00145       i++;                                                      \
00146     }                                                           \
00147   if (encodingNames[i].name)                                    \
00148     {                                                           \
00149       OUTPUTNL(encodingNames[i].name);                          \
00150     }                                                           \
00151 }
00152 
00153 
00154 
00155 #endif //ENCODINGS_H
00156 
00157 
00158 

Generated on Wed Feb 5 10:43:01 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002