Revert "Qt: Try to fix a Visual C++ encoding warning."
authorGerald Combs <gerald@wireshark.org>
Mon, 6 Oct 2014 23:02:16 +0000 (16:02 -0700)
committerGerald Combs <gerald@wireshark.org>
Mon, 6 Oct 2014 23:34:56 +0000 (23:34 +0000)
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 "&apos;". Replace it with "&#x27;".
Remove a QDebug include.

Change-Id: I0e6308efda74a4bc0e67ce841a50a0a9b68f4a8b
Reviewed-on: https://code.wireshark.org/review/4511
Reviewed-by: Gerald Combs <gerald@wireshark.org>
epan/print.c
epan/strutil.c
ui/qt/simple_dialog.cpp
ui/utf8_entities.h

index ed75265180e6be6a060c3e2862d0a251df852aa0..95124a5314e8e768fadf8bd563f90e302da5c6bd 100644 (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))
index ac4e7c41c63ea5111f84c8c3c2123beb206fdcb1..0c598a7aa64edcbbe12faab3a2bbf14ea27f241a 100644 (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;");
index ea3ef218e4bfb522e4f9f10a1d74bc2eb6bfc1c9..f25a653faf4a3d2cec5c77348167147fa6043482 100644 (file)
 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;
index 06eb486ea54a6ae378acf835ec4004189b721843..18b0fc1a59aae85184baa6a40cca1597e11db543 100644 (file)
  * 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__ */
 
 /*