diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/platform/text/qt/TextCodecQt.cpp | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/platform/text/qt/TextCodecQt.cpp')
-rw-r--r-- | WebCore/platform/text/qt/TextCodecQt.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/WebCore/platform/text/qt/TextCodecQt.cpp b/WebCore/platform/text/qt/TextCodecQt.cpp index 888c6af..0f385dd 100644 --- a/WebCore/platform/text/qt/TextCodecQt.cpp +++ b/WebCore/platform/text/qt/TextCodecQt.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> + * Copyright (C) 2008 Holger Hans Peter Freyther * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -91,9 +92,10 @@ TextCodecQt::~TextCodecQt() } -String TextCodecQt::decode(const char* bytes, size_t length, bool flush) +String TextCodecQt::decode(const char* bytes, size_t length, bool flush, bool /*stopOnError*/, bool& sawError) { QString unicode = m_codec->toUnicode(bytes, length, &m_state); + sawError = m_state.invalidChars != 0; if (flush) { m_state.flags = QTextCodec::DefaultConversion; @@ -104,12 +106,12 @@ String TextCodecQt::decode(const char* bytes, size_t length, bool flush) return unicode; } -CString TextCodecQt::encode(const UChar* characters, size_t length, bool allowEntities) +CString TextCodecQt::encode(const UChar* characters, size_t length, UnencodableHandling) { if (!length) return ""; - // FIXME: do something sensible with allowEntities + // FIXME: do something sensible with UnencodableHandling QByteArray ba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), length, 0); return CString(ba.constData(), ba.length()); |