Revert "Qt: Try to fix a Visual C++ encoding warning."

Revert gafa8c02 since it didn't work on Windows. Use a pragma to squelch
Visual C++ instead.

Qt's rich text renderer doesn't handle "'". Replace it with "'".
Remove a QDebug include.

Change-Id: I0e6308efda74a4bc0e67ce841a50a0a9b68f4a8b
Reviewed-on: https://code.wireshark.org/review/4511
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2014-10-06 16:02:16 -07:00
parent a17067abb1
commit 6397ad43c2
4 changed files with 14 additions and 13 deletions

View File

@ -867,7 +867,7 @@ print_escaped_xml(FILE *fh, const char *unescaped_string)
fputs("&quot;", fh);
break;
case '\'':
fputs("&apos;", fh);
fputs("&#x27;", fh);
break;
default:
if (g_ascii_isprint(*p))

View File

@ -921,7 +921,7 @@ xml_escape(const gchar *unescaped)
g_string_append(buffer, "&amp;");
break;
case '\'':
g_string_append(buffer, "&apos;");
g_string_append(buffer, "&#x27;");
break;
case '"':
g_string_append(buffer, "&quot;");

View File

@ -46,7 +46,11 @@
QList<MessagePair> message_queue_;
ESD_TYPE_E max_severity_ = ESD_TYPE_INFO;
const char *primary_delimiter_ = UTF8_NONCHARACTER;
#ifdef _MSC_VER
// Disable "warning C4566: character represented by universal-character-name '\uFFFF' cannot be represented in the current code page (1252)"
#pragma warning(disable:4566)
#endif
const char *primary_delimiter_ = "\uffff";
const char *
simple_dialog_primary_start(void) {
@ -84,7 +88,6 @@ simple_error_message_box(const char *msg_format, ...)
va_end(ap);
}
#include <QDebug>
SimpleDialog::SimpleDialog(QWidget *parent, ESD_TYPE_E type, int btn_mask, const char *msg_format, va_list ap) :
QMessageBox(parent)
{
@ -95,6 +98,7 @@ SimpleDialog::SimpleDialog(QWidget *parent, ESD_TYPE_E type, int btn_mask, const
message = QTextCodec::codecForLocale()->toUnicode(vmessage);
g_free(vmessage);
setTextFormat(Qt::RichText);
MessagePair msg_pair = splitMessage(message);
QString primary = msg_pair.first;
QString secondary = msg_pair.second;

View File

@ -31,17 +31,14 @@
* and other places
*/
#define UTF8_MIDDLE_DOT "\xc2\xb7" /* 183 / 0xb7 */
#define UTF8_MIDDLE_DOT "\xc2\xb7" /* 183 / 0xb7 */
#define UTF8_HORIZONTAL_ELLIPSIS "\xe2\x80\xa6" /* 8230 / 0x2026 */
#define UTF8_LEFTWARDS_ARROW "\xe2\x86\x90" /* 8592 / 0x2190 */
#define UTF8_RIGHTWARDS_ARROW "\xe2\x86\x92" /* 8594 / 0x2192 */
#define UTF8_LEFT_RIGHT_ARROW "\xe2\x86\x94" /* 8596 / 0x2194 */
#define UTF8_PLACE_OF_INTEREST_SIGN "\xe2\x8c\x98" /* 8984 / 0x2318 */
#define UTF8_NONCHARACTER "\xef\xbf\xbf" /* 65535 / 0xffff */
#define UTF8_HORIZONTAL_ELLIPSIS "\xe2\x80\xa6" /* 8230 / 0x2026 */
#define UTF8_LEFTWARDS_ARROW "\xe2\x86\x90" /* 8592 / 0x2190 */
#define UTF8_RIGHTWARDS_ARROW "\xe2\x86\x92" /* 8594 / 0x2192 */
#define UTF8_LEFT_RIGHT_ARROW "\xe2\x86\x94" /* 8596 / 0x2194 */
#define UTF8_PLACE_OF_INTEREST_SIGN "\xe2\x8c\x98" /* 8984 / 0x2318 */
#endif /* __UTF8_ENTITIES_H__ */
/*