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

tdecore

  • tdecore
kidna.cpp
1 /*
2  This file is part of the KDE libraries
3 
4  Copyright (c) 2003 Waldo Bastian <bastian@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "kidna.h"
23 
24 #ifndef Q_WS_WIN //TODO kresolver not ported
25 #include "kresolver.h"
26 #endif
27 #include <kdebug.h>
28 
29 #ifndef Q_WS_WIN //TODO knetwork not ported
30 using namespace KNetwork;
31 #endif
32 
33 TQCString KIDNA::toAsciiCString(const TQString &idna)
34 {
35 #ifndef Q_WS_WIN //TODO kresolver not ported
36  return KResolver::domainToAscii(idna);
37 #else
38  return TQCString();
39 #endif
40 }
41 
42 TQString KIDNA::toAscii(const TQString &idna)
43 {
44  if (idna.length() && (idna[0] == (QChar)'.'))
45  {
46  TQString host = TQString::fromLatin1(toAsciiCString(idna.mid(1)));
47  if (host.isEmpty())
48  return TQString::null; // Error
49  return idna[0] + host;
50  }
51  return TQString::fromLatin1(toAsciiCString(idna));
52 }
53 
54 TQString KIDNA::toUnicode(const TQString &idna)
55 {
56 #ifndef Q_WS_WIN //TODO kresolver not ported
57  if (idna.length() && (idna[0] == (QChar)'.'))
58  return idna[0] + KResolver::domainToUnicode(idna.mid(1));
59  return KResolver::domainToUnicode(idna);
60 #else
61  return TQString::null;
62 #endif
63 }
KNetwork::KResolver::domainToUnicode
static TQString domainToUnicode(const TQCString &asciiDomain)
Does the inverse of domainToAscii and return an Unicode domain name from the given ACE-encoded domain...
Definition: kresolver.cpp:1073
KNetwork
A namespace to store all networking-related (socket) classes.
Definition: kbufferedsocket.h:36
KNetwork::KResolver::domainToAscii
static TQCString domainToAscii(const TQString &unicodeDomain)
Returns the domain name in an ASCII Compatible Encoding form, suitable for DNS lookups.
Definition: kresolver.cpp:1035

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.