Skip to content

Commit

Permalink
print.c: use utf8_entities.h
Browse files Browse the repository at this point in the history
Change-Id: I92791ec51978be59944628b7eaccd2784dd72be1
Reviewed-on: https://code.wireshark.org/review/11089
Petri-Dish: Pascal Quantin <[email protected]>
Tested-by: Petri Dish Buildbot <[email protected]>
Reviewed-by: Pascal Quantin <[email protected]>
  • Loading branch information
pquantin committed Oct 16, 2015
1 parent 0921fdd commit 4c168db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions epan/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <epan/charsets.h>
#include <wsutil/filesystem.h>
#include <wsutil/ws_version_info.h>
#include <wsutil/utf8_entities.h>
#include <ftypes/ftypes-int.h>

#define PDML_VERSION "0"
Expand Down Expand Up @@ -654,7 +655,7 @@ static gchar *csv_massage_str(const gchar *source, const gchar *exceptions)
csv_str = g_strescape(source, exceptions);
tmp_str = csv_str;
/* Locate the UTF-8 right arrow character and replace it by an ASCII equivalent */
while ( (tmp_str = strstr(tmp_str, "\xe2\x86\x92")) != NULL ) {
while ( (tmp_str = strstr(tmp_str, UTF8_RIGHTWARDS_ARROW)) != NULL ) {
tmp_str[0] = ' ';
tmp_str[1] = '>';
tmp_str[2] = ' ';
Expand All @@ -669,8 +670,8 @@ static void csv_write_str(const char *str, char sep, FILE *fh)
{
gchar *csv_str;

/* Do not escape the UTF-8 righ arrow character */
csv_str = csv_massage_str(str, "\xe2\x86\x92");
/* Do not escape the UTF-8 right arrow character */
csv_str = csv_massage_str(str, UTF8_RIGHTWARDS_ARROW);
fprintf(fh, "\"%s\"%c", csv_str, sep);
g_free(csv_str);
}
Expand Down

0 comments on commit 4c168db

Please sign in to comment.