Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F16569360
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/kdecore/tests/kcharsetstest.cpp b/kdecore/tests/kcharsetstest.cpp
index 66d44e74f2..e47fec07b6 100644
--- a/kdecore/tests/kcharsetstest.cpp
+++ b/kdecore/tests/kcharsetstest.cpp
@@ -1,30 +1,34 @@
#include <kcharsets.h>
#include <kdebug.h>
#include <QtCore/QString>
#include <assert.h>
int main()
{
// Note: ctest sets LANG=C, while running the test directly uses your real $LANG.
// And since the static initializer runs before main, we cannot setenv("LANG") here,
// it's too late.
//kDebug() << "LANG=" << getenv("LANG");
//kDebug() << "LC_ALL=" << getenv("LC_ALL");
// Test that toLocal8Bit works even without a QCoreApplication,
// thanks to the static initializer in KCatalog.
// Do NOT move this code to a QTestLib unit test ;-)
QString one = QString::fromUtf8("é");
QByteArray one8bit = one.toLocal8Bit();
- if (qgetenv("LANG").endsWith("UTF-8")) { // krazy:exclude=strings
+ QByteArray lang = qgetenv("LC_ALL");
+ if (lang.isEmpty()) {
+ lang = qgetenv("LANG");
+ }
+ if (lang.endsWith("UTF-8")) { // krazy:exclude=strings
kDebug() << one << one8bit;
Q_ASSERT(one8bit.length() == 2);
}
QString input( "<Hello &World>" );
QString output = KCharsets::resolveEntities( input );
assert( output == "<Hello &World>" );
return 0;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Nov 1, 8:23 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10074957
Default Alt Text
(1 KB)
Attached To
Mode
rKL kdelibs
Attached
Detach File
Event Timeline
Log In to Comment