• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
kcharsets.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #include "kcharsets.h"
20 
21 #include "kqiodevicegzip_p.h"
22 #include "kentities.c"
23 
24 #include <tdeapplication.h>
25 #include <tdeglobal.h>
26 #include <tdelocale.h>
27 #include <tdeconfig.h>
28 
29 #include <tqfontinfo.h>
30 #include <tqstrlist.h>
31 #include <tqfontdatabase.h>
32 #include <kdebug.h>
33 
34 #include <tqtextcodec.h>
35 #include <tqmap.h>
36 #include <tqcstring.h>
37 #include <tqdir.h>
38 #include <tqregexp.h>
39 
40 #include <assert.h>
41 
42 static const char * const language_names[] = {
43  I18N_NOOP( "Other" ),
44  I18N_NOOP( "Arabic" ),
45  I18N_NOOP( "Baltic" ),
46  I18N_NOOP( "Central European" ),
47  I18N_NOOP( "Chinese Simplified" ),
48  I18N_NOOP( "Chinese Traditional" ),
49  I18N_NOOP( "Cyrillic" ),
50  I18N_NOOP( "Greek" ),
51  I18N_NOOP( "Hebrew" ),
52  I18N_NOOP( "Japanese" ),
53  I18N_NOOP( "Korean" ),
54  I18N_NOOP( "Thai" ),
55  I18N_NOOP( "Turkish" ),
56  I18N_NOOP( "Western European" ),
57  I18N_NOOP( "Tamil" ),
58  I18N_NOOP( "Unicode" ),
59  I18N_NOOP( "Northern Saami" ),
60  I18N_NOOP( "Vietnamese" ),
61  I18N_NOOP( "South-Eastern Europe" )
62 };
63 
64 // This list gives the charsets that can be used to display a file given in a certain encoding.
65 // The list should be in order of preference
66 static const char* const charsets_for_encoding[] = {
67  "koi8-r",
68  "koi8-u",
69  "iso 8859-1",
70  "iso 8859-2",
71  "iso 8859-3",
72  "iso 8859-4",
73  "iso 8859-5",
74  "iso 8859-6",
75  "iso 8859-7",
76  "iso 8859-8",
77  "iso 8859-8-i",
78  "iso 8859-9",
79  "iso 8859-11",
80  "iso 8859-13",
81  "iso 8859-14",
82  "iso 8859-15",
83  "iso 8859-16",
84  "utf8",
85  "utf16",
86  "iso-10646-ucs-2",
87  "cp 1250",
88  "cp 1251",
89  "cp 1252",
90  "cp 1253",
91  "cp 1254",
92  "cp 1255",
93  "cp 1256",
94  "cp 1257",
95  "cp 1258",
96  "ibm850",
97  "ibm852",
98  "ibm866",
99  "tis620",
100  "eucjp",
101  "sjis",
102  "jis7",
103  "big5",
104  "big5-hkscs",
105  "gbk",
106  "gb18030",
107  "gb2312",
108  "euckr",
109  "tscii",
110 // "pt 154",
111  "winsami2",
112  "cp 874",
113  0 }; // extra 0 for end
114 
115 // 0 other
116 // 1 Arabic
117 // 2 Baltic
118 // 3 Central European
119 // 4 Chinese Simplified
120 // 5 Chinese Traditional
121 // 6 Cyrillic
122 // 7 Greek
123 // 8 Hebrew
124 // 9 Japanese
125 // 10 Korean
126 // 11 Thai
127 // 12 Turkish
128 // 13 Western European
129 // 14 Tamil
130 // 15 Unicode
131 // 16 Northern Sami
132 // 17 Vietnamese
133 // 18 South-Eastern Europe
134 // ### FIXME KDE4: the name of the encodings should mostly be uppercase
135 static struct LanguageForEncoding
136  {
137  const char* index;
138  int data;
139  } const language_for_encoding[] = {
140  { "iso 8859-1", 13 },
141  { "iso 8859-15", 13 },
142  { "iso 8859-14", 13 },
143  { "cp 1252", 13 },
144  { "ibm850", 13 },
145  { "iso 8859-2", 3 },
146  { "iso 8859-3", 3 },
147  { "iso 8859-4", 2 },
148  { "iso 8859-13", 2 },
149  { "iso 8859-16", 18 },
150  { "cp 1250", 3 },
151  { "cp 1254", 12 },
152  { "cp 1257", 2 },
153  { "ibm852", 3 },
154  { "koi8-r", 6 },
155  { "iso 8859-5", 6 },
156  { "cp 1251", 6 },
157  { "koi8-u", 6 },
158 // { "pt 154", 6 },
159  { "ibm866", 6 },
160  { "big5", 5 },
161  { "big5-hkscs", 5 },
162  { "gb18030", 4 },
163  { "gbk", 4 },
164  { "gb2312", 4 },
165  { "euckr", 10 },
166  { "sjis", 9 },
167  { "jis7", 9 },
168  { "eucjp", 9 },
169  { "iso 8859-7", 7 },
170  { "cp 1253", 7 },
171  { "iso 8859-6", 1 },
172  { "cp 1256", 1 },
173  { "iso 8859-8", 8 },
174  { "iso 8859-8-i", 8 },
175  { "cp 1255", 8 },
176  { "iso 8859-9", 12 },
177  { "tis620", 11 },
178  { "iso 8859-11", 11 },
179  { "cp 874", 11 },
180  { "cp 1258", 17 },
181  { "tscii", 14 },
182  { "utf8", 15 },
183  { "utf16", 15 },
184  { "utf7", 15 }, // ### FIXME: UTF-7 is not in Qt
185  { "ucs2", 15 },
186  { "iso-10646-ucs-2", 15 },
187  { "winsami2", 16},
188  { 0, 0 } };
189 
190 // defines some different names for codecs that are built into Qt.
191 static struct Builtin
192  {
193  const char* index;
194  const char* data;
195  } const builtin[] = {
196  { "iso-ir-111", "koi8-r" },
197  { "koi8-ru", "koi8-u" }, // ### Qt 3.3 maps it to koi8-r
198  { "koi unified", "koi8-r" }, // ### FIXME: Qt 3.3 seems to map this to EUC-KR, so this mapping is too late :-(
199  // Using ISO-8859-1 for ASCII is an approximation at write
200  { "us-ascii", "iso 8859-1" },
201  { "usascii", "iso 8859-1" },
202  { "ascii", "iso 8859-1" },
203  { "x-utf-8", "utf-8" },
204  { "x-utf-7", "utf-7" }, // ### FIXME: UTF-7 is not in Qt
205  { "unicode-1-1-utf-7", "utf-7" }, // ### FIXME: UTF-7 is not in Qt
206  { "utf-16", "iso-10646-ucs-2" },
207  { "utf16", "iso-10646-ucs-2" },
208  { "ucs2", "iso-10646-ucs-2" },
209  { "iso10646-1", "iso-10646-ucs-2" },
210  { "gb18030.2000-1", "gb18030" },
211  { "gb18030.2000-0", "gb18030" },
212  { "gbk-0", "gbk" },
213  { "gb2312.1980-0", "gbk" },
214  { "gb_2312-80", "gbk" },/* this one is not official, but MS is using it :/ */
215  { "x-euc-kr", "euckr" },
216  { "jisx0201.1976-0", "eucjp" },
217  { "jisx0208.1983-0", "eucjp" },
218  { "jisx0208.1990-0", "eucjp" },
219  { "jisx0208.1997-0", "eucjp" },
220  { "jisx0212.1990-0", "eucjp" },
221  { "jisx0213.2000-1", "eucjp" },
222  { "jisx0213.2000-2", "eucjp" },
223  { "windows850", "ibm850" },
224  { "windows866", "ibm866" },
225  { "windows1251", "cp 1251" },
226  { "windows1252", "cp 1252" },
227  { "windows1253", "cp 1253" },
228  { "windows1254", "cp 1254" },
229  { "windows1255", "cp 1255" },
230  { "windows1256", "cp 1256" },
231  { "windows1257", "cp 1257" },
232  { "windows1258", "cp 1258" },
233  { "windows-850", "ibm850" },
234  { "windows-866", "ibm866" },
235  { "x-windows-850", "ibm850" },
236  { "x-windows-866", "ibm866" },
237  { "x-windows-1250", "cp 1250" },
238  { "x-windows-1251", "cp 1251" },
239  { "x-windows-1252", "cp 1252" },
240  { "x-windows-1253", "cp 1253" },
241  { "x-windows-1254", "cp 1254" },
242  { "x-windows-1255", "cp 1255" },
243  { "x-windows-1256", "cp 1256" },
244  { "x-windows-1257", "cp 1257" },
245  { "x-windows-1258", "cp 1258" },
246  { "cp819", "iso 8859-1" },
247  { "cp850", "ibm850" },
248  { "cp866", "ibm866" },
249  { "cp-819", "iso 8859-1" },
250  { "cp-850", "ibm850" },
251  { "cp-866", "ibm866" },
252  { "cp-1250", "cp 1250" },
253  { "cp-1251", "cp 1251" },
254  { "cp-1252", "cp 1252" },
255  { "cp-1253", "cp 1253" },
256  { "cp-1254", "cp 1254" },
257  { "cp-1255", "cp 1255" },
258  { "cp-1256", "cp 1256" },
259  { "cp-1257", "cp 1257" },
260  { "cp-1258", "cp 1258" },
261  { "cp-10000", "apple roman" },
262  { "x-cp-850", "ibm850" },
263  { "x-cp-866", "ibm866" },
264  { "x-cp-1250", "cp 1250" },
265  { "x-cp-1251", "cp 1251" },
266  { "x-cp-1252", "cp 1252" },
267  { "x-cp-1253", "cp 1253" },
268  { "x-cp-1254", "cp 1254" },
269  { "x-cp-1255", "cp 1255" },
270  { "x-cp-1256", "cp 1256" },
271  { "x-cp-1257", "cp 1257" },
272  { "x-cp-1258", "cp 1258" },
273  { "x-cp-10000", "apple roman" },
274  { "ibm819", "iso 8859-1" },
275  { "thai-tis620", "iso 8859-11" },
276  { "windows-874", "cp 874" },
277  { "windows874", "cp 874" },
278  { "x-windows-874", "cp 874" },
279  { "x-cp-874", "cp 874" },
280  { "ibm 874", "cp 874" },
281  { "ibm874", "cp 874" }, // Qt4 name
282  { "x-ibm874", "cp 874" },
283  { "ksc5601.1987-0", "euckr" },
284  { "x-winsami2", "winsami2" },
285  { "x-mac-roman", "apple roman" },
286  { "macintosh", "apple roman" },
287  { "mac", "apple roman" },
288  { "csiso2022jp", "jis7" }, // See bug #77243
289  { "big5-eten", "big5-hkscs" },
290  { "cp950", "big5-hkscs" },
291  { 0, 0 }};
292 
293 // some different names for the encodings defined in the charmaps files.
294 // even though the charmap file names are all uppercase, the names are all lowercase here.
295 static struct Aliases
296  {
297  const char* index;
298  const char* data;
299  } const aliases[] = {
300  { "cp852", "ibm852" },
301  { "cp-852", "ibm852" },
302  { "x-cp-852", "ibm852" },
303  { "windows852", "ibm852" },
304  { "windows-852", "ibm852" },
305  { "x-windows-852", "ibm852" },
306  { 0, 0 }};
307 
308 // some last resort hints in case the charmap file couldn't be found. This gives at least a partial conversion
309 // and helps making things readable.
310 // the name used as input here is already converted to the more canonical name as defined in the aliases array.
311 static struct ConversionHints
312  {
313  const char* index;
314  const char* data;
315  } const conversion_hints[] = {
316  { "cp1250", "iso-8859-2" },
317  { "koi8-r", "iso-8859-5" },
318  { "koi8-u", "koi8-r" },
319  // KDE had always "CP 1251" as best fallback to PT 154. Now that Qt does not offer this encoding anymore, it is our fallback.
320  { "pt 154", "cp 1251" },
321  { "paratype-154", "cp 1251" },
322  { "pt-154", "cp 1251" },
323  { 0, 0 }};
324 
325 
326 // search an array of items index/data, index is const char*, data is T, find first matching index
327 // and return data, or return 0
328 template< typename T, typename Data >
329 static Data kcharsets_array_search( const T* start, const char* entry )
330 {
331  for( const T* pos = start;
332  pos->index != 0;
333  ++pos )
334  if( qstrcmp( pos->index, entry ) == 0 )
335  return pos->data;
336  return 0;
337 }
338 
339 
340 class KCharsetsPrivate
341 {
342 public:
343  KCharsetsPrivate(KCharsets* _kc)
344  : codecForNameDict(43, false) // case insensitive
345  {
346  db = 0;
347  kc = _kc;
348  }
349  ~KCharsetsPrivate()
350  {
351  delete db;
352  }
353  TQFontDatabase *db;
354  TQAsciiDict<TQTextCodec> codecForNameDict;
355  KCharsets* kc;
356 };
357 
358 // --------------------------------------------------------------------------
359 
360 KCharsets::KCharsets()
361 {
362  d = new KCharsetsPrivate(this);
363 }
364 
365 KCharsets::~KCharsets()
366 {
367  delete d;
368 }
369 
370 TQChar KCharsets::fromEntity(const TQString &str)
371 {
372  TQChar res = TQChar::null;
373 
374  int pos = 0;
375  if(str[pos] == (QChar)'&') pos++;
376 
377  // Check for '&#000' or '&#x0000' sequence
378  if (str[pos] == (QChar)'#' && str.length()-pos > 1) {
379  bool ok;
380  pos++;
381  if (str[pos] == (QChar)'x' || str[pos] == (QChar)'X') {
382  pos++;
383  // '&#x0000', hexadeciaml character reference
384  TQString tmp(str.unicode()+pos, str.length()-pos);
385  res = tmp.toInt(&ok, 16);
386  } else {
387  // '&#0000', decimal character reference
388  TQString tmp(str.unicode()+pos, str.length()-pos);
389  res = tmp.toInt(&ok, 10);
390  }
391  return res;
392  }
393 
394  const entity *e = kde_findEntity(str.ascii(), str.length());
395 
396  if(!e)
397  {
398  //kdDebug( 0 ) << "unknown entity " << str <<", len = " << str.length() << endl;
399  return TQChar::null;
400  }
401  //kdDebug() << "got entity " << str << " = " << e->code << endl;
402 
403  return TQChar(e->code);
404 }
405 
406 TQChar KCharsets::fromEntity(const TQString &str, int &len)
407 {
408  // entities are never longer than 8 chars... we start from
409  // that length and work backwards...
410  len = 8;
411  while(len > 0)
412  {
413  TQString tmp = str.left(len);
414  TQChar res = fromEntity(tmp);
415  if( res != (QChar)TQChar::null ) return res;
416  len--;
417  }
418  return TQChar::null;
419 }
420 
421 
422 TQString KCharsets::toEntity(const TQChar &ch)
423 {
424  TQString ent;
425  ent.sprintf("&#0x%x;", ch.unicode());
426  return ent;
427 }
428 
429 TQString KCharsets::resolveEntities( const TQString &input )
430 {
431  TQString text = input;
432  const TQChar *p = text.unicode();
433  const TQChar *end = p + text.length();
434  const TQChar *ampersand = 0;
435  bool scanForSemicolon = false;
436 
437  for ( ; p < end; ++p ) {
438  const TQChar ch = *p;
439 
440  if ( ch == (QChar)'&' ) {
441  ampersand = p;
442  scanForSemicolon = true;
443  continue;
444  }
445 
446  if ( ch != (QChar)';' || scanForSemicolon == false )
447  continue;
448 
449  assert( ampersand );
450 
451  scanForSemicolon = false;
452 
453  const TQChar *entityBegin = ampersand + 1;
454 
455  const uint entityLength = p - entityBegin;
456  if ( entityLength == 0 )
457  continue;
458 
459  const TQChar entityValue = KCharsets::fromEntity( TQConstString( entityBegin, entityLength ).string() );
460  if ( entityValue.isNull() )
461  continue;
462 
463  const uint ampersandPos = ampersand - text.unicode();
464 
465  text[ (int)ampersandPos ] = entityValue;
466  text.remove( ampersandPos + 1, entityLength + 1 );
467  p = text.unicode() + ampersandPos;
468  end = text.unicode() + text.length();
469  ampersand = 0;
470  }
471 
472  return text;
473 }
474 
475 TQStringList KCharsets::availableEncodingNames()
476 {
477  TQStringList available;
478  for ( const char* const* pos = charsets_for_encoding; *pos; ++pos ) {
479  //kdDebug(0) << *charsets << " available" << endl;
480  available.append( TQString::fromLatin1( *pos ));
481  }
482  return available;
483 }
484 
485 TQString KCharsets::languageForEncoding( const TQString &encoding )
486 {
487  int lang = kcharsets_array_search< LanguageForEncoding, int >
488  ( language_for_encoding, encoding.latin1());
489  return i18n( language_names[lang] );
490 }
491 
492 TQString KCharsets::encodingForName( const TQString &descriptiveName )
493 {
494  const int left = descriptiveName.findRev( '(' );
495 
496  if (left<0) // No parenthesis, so assume it is a normal encoding name
497  return descriptiveName.stripWhiteSpace();
498 
499  TQString name(descriptiveName.mid(left+1));
500 
501  const int right = name.findRev( ')' );
502 
503  if (right<0)
504  return name;
505 
506  return name.left(right).stripWhiteSpace();
507 }
508 
509 TQStringList KCharsets::descriptiveEncodingNames()
510 {
511  // As we are sorting, we can directly read the array language_for_encoding
512  TQStringList encodings;
513  for ( const LanguageForEncoding* pos = language_for_encoding; pos->index; ++pos ) {
514  const TQString name = TQString::fromLatin1( pos->index );
515  const TQString description = i18n( language_names[ pos->data ] );
516  encodings.append( i18n("Descriptive Encoding Name", "%1 ( %2 )"). arg ( description ). arg( name ) );
517  }
518  encodings.sort();
519  return encodings;
520 }
521 
522 TQTextCodec *KCharsets::codecForName(const TQString &n) const
523 {
524  bool b;
525  return codecForName( n, b );
526 }
527 
528 TQTextCodec *KCharsets::codecForName(const TQString &n, bool &ok) const
529 {
530  ok = true;
531 
532  TQTextCodec* codec = 0;
533  // dict lookup is case insensitive anyway
534  if((codec = d->codecForNameDict[n.isEmpty() ? "->locale<-" : n.latin1()]))
535  return codec; // cache hit, return
536 
537  if (n.isEmpty()) {
538  codec = TDEGlobal::locale()->codecForEncoding();
539  d->codecForNameDict.replace("->locale<-", codec);
540  return codec;
541  }
542 
543  TQCString name = n.lower().latin1();
544  TQCString key = name;
545  if (name.right(8) == "_charset")
546  name.truncate(name.length()-8);
547 
548  if (name.isEmpty()) {
549  ok = false;
550  return TQTextCodec::codecForName("iso8859-1");
551  }
552 
553  codec = TQTextCodec::codecForName(name);
554 
555  if(codec) {
556  d->codecForNameDict.replace(key, codec);
557  return codec;
558  }
559 
560  // these codecs are built into Qt, but the name given for the codec is different,
561  // so TQTextCodec did not recognize it.
562  TQCString cname = kcharsets_array_search< Builtin, const char* >( builtin, name.data());
563 
564  if(!cname.isEmpty())
565  codec = TQTextCodec::codecForName(cname);
566 
567  if(codec)
568  {
569  d->codecForNameDict.replace(key, codec);
570  return codec;
571  }
572 
573  TQString dir;
574  {
575  TDEConfigGroupSaver cfgsav( TDEGlobal::config(), "i18n" );
576  dir = TDEGlobal::config()->readPathEntry("i18ndir", TQString::fromLatin1("/usr/share/i18n/charmaps"));
577  }
578 
579  // these are codecs not included in Qt. They can be build up if the corresponding charmap
580  // is available in the charmap directory.
581  cname = kcharsets_array_search< Aliases, const char* >( aliases, name.data());
582 
583  if(cname.isEmpty())
584  cname = name;
585  cname = cname.upper();
586 
587  const TQString basicName = TQString::fromLatin1(cname);
588  kdDebug() << k_funcinfo << endl << " Trying to find " << cname << " in " << dir << endl;
589 
590  TQString charMapFileName;
591  bool gzipped = false;
592  TQDir qdir(dir);
593  if (!qdir.exists()) {
594  // The directory for the charmaps does not even exist... (That is common!)
595  }
596  else if (qdir.exists(basicName, false)) {
597  charMapFileName = basicName;
598  }
599  else if (qdir.exists(basicName+".gz", false)) {
600  charMapFileName = basicName + ".gz";
601  gzipped = true;
602  }
603  else {
604  // Check if we are asking a code page
605  // If yes, then check "CP99999" and "IBM99999"
606  // First we need to find the number of the codepage
607  TQRegExp regexp("^(X-)?(CP|IBM)(-| )?(0-9)+");
608  if ( regexp.search(basicName) != -1) {
609  const TQString num = regexp.cap(4);
610  if (num.isEmpty()) {
611  // No number, not a code page (or something went wrong)
612  }
613  else if (qdir.exists("IBM"+num)) {
614  charMapFileName = "IBM"+num;
615  }
616  else if (qdir.exists("IBM"+num+".gz")) {
617  charMapFileName = "IBM"+num+".gz";
618  gzipped = true;
619  }
620  else if (qdir.exists("CP"+num)) {
621  charMapFileName = "CP"+num;
622  }
623  else if (qdir.exists("CP"+num+".gz")) {
624  charMapFileName = "CP"+num+".gz";
625  gzipped = true;
626  }
627  }
628  }
629 
630  if (gzipped && !charMapFileName.isEmpty()) {
631  KQIODeviceGZip gzip(dir + "/" + charMapFileName);
632  if (gzip.open(IO_ReadOnly)) {
633  kdDebug() << "Loading gzipped charset..." << endl;
634  codec = TQTextCodec::loadCharmap(&gzip);
635  gzip.close();
636  }
637  else
638  kdWarning() << "Could not open gzipped charset!" << endl;
639  }
640  else if (!charMapFileName.isEmpty()) {
641  codec = TQTextCodec::loadCharmapFile(dir + "/" + charMapFileName);
642  }
643 
644  if(codec) {
645  d->codecForNameDict.replace(key, codec);
646  return codec;
647  }
648 
649  // this also failed, the last resort is now to take some compatibility charmap
650 
651  cname = kcharsets_array_search< ConversionHints, const char* >( conversion_hints, (const char*)name.data() );
652 
653  if(!cname.isEmpty())
654  codec = TQTextCodec::codecForName(cname);
655 
656  if(codec) {
657  d->codecForNameDict.replace(key, codec);
658  return codec;
659  }
660 
661  // could not assign a codec, let's return Latin1
662  ok = false;
663  return TQTextCodec::codecForName("iso8859-1");
664 }
KCharsets
Charset font and encoder/decoder handling.
Definition: kcharsets.h:43
TDEConfigGroupSaver
Helper class to facilitate working with TDEConfig / KSimpleConfig groups.
Definition: tdeconfigbase.h:2082
KCharsets::KCharsets
KCharsets()
Protected constructor.
Definition: kcharsets.cpp:360
KCharsets::~KCharsets
virtual ~KCharsets()
Destructor.
Definition: kcharsets.cpp:365
KCharsets::descriptiveEncodingNames
TQStringList descriptiveEncodingNames()
Lists the available encoding names together with a more descriptive language.
Definition: kcharsets.cpp:509
TDELocale::I18N_NOOP
#define I18N_NOOP(x)
Definition: tdelocale.h:51
KCharsets::fromEntity
static TQChar fromEntity(const TQString &str)
Converts an entity to a character.
Definition: kcharsets.cpp:370
tdelocale.h
KCharsets::toEntity
static TQString toEntity(const TQChar &ch)
Converts a TQChar to an entity.
Definition: kcharsets.cpp:422
KCharsets::encodingForName
TQString encodingForName(const TQString &descriptiveName)
Returns the encoding for a string obtained with descriptiveEncodingNames().
Definition: kcharsets.cpp:492
KCharsets::languageForEncoding
TQString languageForEncoding(const TQString &encoding)
Returns the language the encoding is used for.
Definition: kcharsets.cpp:485
TDEGlobal::locale
static TDELocale * locale()
Returns the global locale object.
Definition: tdeglobal.cpp:108
KCharsets::codecForName
TQTextCodec * codecForName(const TQString &name) const
Provided for compatibility.
Definition: kcharsets.cpp:522
TDELocale::codecForEncoding
TQTextCodec * codecForEncoding() const
Returns the user's preferred encoding.
Definition: tdelocale.cpp:2304
KCharsets::availableEncodingNames
TQStringList availableEncodingNames()
Lists all available encodings as names.
Definition: kcharsets.cpp:475
TDEConfigBase::readPathEntry
TQString readPathEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads a path.
Definition: tdeconfigbase.cpp:609
TDEGlobal::config
static TDEConfig * config()
Returns the general config object.
Definition: tdeglobal.cpp:65
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
KCharsets::resolveEntities
static TQString resolveEntities(const TQString &text)
Scans the given string for entities (like &) and resolves them using fromEntity.
Definition: kcharsets.cpp:429

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.