diff options
author | Holger Ihrig <holger.ihrig@nokia.com> | 2011-08-24 10:30:49 +0200 |
---|---|---|
committer | Holger Ihrig <holger.ihrig@nokia.com> | 2011-08-26 08:49:59 +0200 |
commit | 7b686abdd5bedcb32b5dbd19655df2e43f6242fd (patch) | |
tree | f1f7a79ba2c72d904fb0afb22d75c346062a44fa /tests/auto/corelib/codecs/qtextcodec/echo/main.cpp | |
parent | 5e6605f7b006225f112b92956961974c8c8ad1a9 (diff) |
Moving relevant tests to corelib/codecs
Task-number: QTBUG-21066
Change-Id: If33bda9622bbfdac2b72ec2bf8489b0f62bae6e2
Reviewed-on: http://codereview.qt.nokia.com/3469
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/corelib/codecs/qtextcodec/echo/main.cpp')
-rw-r--r-- | tests/auto/corelib/codecs/qtextcodec/echo/main.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp b/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp new file mode 100644 index 0000000000..774cab1a9b --- /dev/null +++ b/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <stdlib.h> +#include <stdio.h> +#include <QtCore> + +int main(int argc, char **argv) +{ + static char lc_all[] = "LC_ALL=C"; + putenv(lc_all); + QCoreApplication app(argc, argv); + + QString string(QChar(0x410)); + QTextCodec *locale = QTextCodec::codecForLocale(); + QTextEncoder *encoder = locale->makeEncoder(); + QByteArray output = encoder->fromUnicode(string); + printf("%s\n", output.data()); + + return 0; +} |