summaryrefslogtreecommitdiff
path: root/pcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-07-19 03:07:55 -0700
committerGuy Harris <guy@alum.mit.edu>2018-07-20 02:37:28 -0700
commit798e278db29971980d94d65628dd2d58f0c5b161 (patch)
tree565bc8abd6726091383c18668bafd8fad3407acc /pcap.c
parent8ae2271d77523fb8ae685c033a132c27f45425a0 (diff)
downloadlibpcap-798e278db29971980d94d65628dd2d58f0c5b161.tar.gz
Force FormatMessageA().
Internally, we're using encodings in which ASCII characters are represented in a single byte, so message strings must be "ANSI", not "Unicode". Yes, that means they'll be in the current code page, which isn't necessarily - and probably isn't - UTF-8, but Windows really doesn't seem to provide much support for UTF-8 as a representation of Unicode (the current code page isn't necessarily 65001, i.e. UTF-8, especially given that some software appears to have problems with that code page on at least some versions of Windows). See GitHub issue pynetwork/pypcap#64. (cherry picked from commit a5341c3b81a4d7f00b5318c6d8fa8673eda81611)
Diffstat (limited to 'pcap.c')
-rw-r--r--pcap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pcap.c b/pcap.c
index 67e54671..942c472a 100644
--- a/pcap.c
+++ b/pcap.c
@@ -3251,7 +3251,7 @@ pcap_win32_err_to_str(DWORD error, char *errbuf)
size_t errlen;
char *p;
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errbuf,
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errbuf,
PCAP_ERRBUF_SIZE, NULL);
/*