Use tvb_get_string_enc() rather than tvb_get_string(). The specs say
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 23 Jan 2014 01:45:55 +0000 (01:45 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 23 Jan 2014 01:45:55 +0000 (01:45 +0000)
ASCII, but there's a proposal to use UTF-8.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@54921 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-aprs.c

index 1209198d93b44a7037a3391819ec38dba5471d93..5ce0a8b07cd63a0f8845b8f8d353a86fb00d0adc 100644 (file)
@@ -999,8 +999,12 @@ dissect_aprs_weather(      tvbuff_t   *tvb,
                                        /* optional: software type/unit: see if present */
                                        lr = new_offset - offset;
 #if 0 /* fcn'al change: defer */
+                                       /*
+                                        * XXX - ASCII or UTF-8?
+                                        * See http://www.aprs.org/aprs12/utf-8.txt
+                                        */
                                        if ( ((lr < 3) || (lr > 5)) ||
-                                               ( lr != strspn( tvb_get_string( wmem_packet_scope(), tvb, offset, lr ), "a-zA-Z0-9-_" ) ) )
+                                               ( lr != strspn( tvb_get_string_enc( wmem_packet_scope(), tvb, offset, lr, ENC_ASCII|ENC_NA ), "a-zA-Z0-9-_" ) ) )
                                                {
                                                new_offset = offset;  /* Assume rest is a comment: force exit from while */
                                                break;  /* from switch */
@@ -1132,7 +1136,11 @@ aprs_item( proto_tree *aprs_tree, tvbuff_t *tvb, int offset )
 
        data_len    = 10;
 
-       info_buffer = tvb_get_string( wmem_packet_scope(), tvb, offset, data_len );
+       /*
+        * XXX - ASCII or UTF-8?
+        * See http://www.aprs.org/aprs12/utf-8.txt
+        */
+       info_buffer = tvb_get_string_enc( wmem_packet_scope(), tvb, offset, data_len, ENC_ASCII|ENC_NA );
 
        ch_ptr = strchr( info_buffer, '!' );
        if ( ch_ptr != NULL )