ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] wireshark-0.99.7 compiling error, The file contains a charac

From: "Juntao Lv" <lvjuntao2008@xxxxxxxxx>
Date: Fri, 25 Jan 2008 01:04:39 +0800
Thanks for all

Finally I use the program notepad to save the files below  in Unicode  format, and compiling wireshark-0.99.7 has passed.

The files converted:
wireshark-0.99.7\wiretap\dbs-etherwatch.c
wireshark-0.99.7\epan\dissectors\packet-ansi_map.c
wireshark-0.99.7\epan\dissectors\packet-bacapp.c
wireshark-0.99.7\epan\dissectors\packet-bacapp.h
wireshark-0.99.7\epan\dissectors\packet-cisco-erspan.c
wireshark-0.99.7\epan\packet-e212.c
wireshark-0.99.7\epan\packet-per.c
wireshark-0.99.7\epan\packet-wbxml.c
wireshark-0.99.7\asn1\ansi_map\packet-ansi_map-template.c

also, Maybe use iconv for win32 to batchly convert these files .

iconv for win32 download address: http://downloads.sourceforge.net/gnuwin32/libiconv-1.9.2-1.exe?modtime=1138549015&big_mirror=1

compiling system info:
OS: windows xp sp2 (code page 936)
C compiler: Visual C++ 2005 Express Edition
Platform SDK: SDK Server 2003 R2



----- Original Message ----- 
From: "Graham Bloice" <graham.bloice@xxxxxxxxxxxxx>
To: "Developer support list for Wireshark" <wireshark-dev@xxxxxxxxxxxxx>
Sent: Thursday, January 24, 2008 10:06 PM
Subject: Re: [Wireshark-dev] wireshark-0.99.7 compiling error, The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss


> Guy Harris wrote:
>> Graham Bloice wrote:
>>
>>   
>>> As per the VS2005 help:
>>>
>>>     
>>>> C4819 occurs when an ANSI source file is compiled on a system with a 
>>>> codepage that cannot represent all characters in the file.
>>>>
>>>> To resolve C4819, save the file in Unicode format.
>>>>       
>>> So, you either use a codepage that does support ANSI, or you somehow 
>>> convert all the files to unicode which would be a real pain when ever 
>>> you update your sources to the latest.
>>>     
>>
>> ...or we find all the non-ASCII characters in the files (or, at least, 
>> the ones that cause problems; I don't know whether MSVC has problems 
>> with comments) and get rid of them.  I've removed non-ASCII characters 
>> from at least some character strings - they don't belong there, as there's
>>
>> 1) no guarantee that they can be displayed on all platforms (especially 
>> with GTK+ 1.2.x, which doesn't use UTF-8)
>>
>> and
>>
>> 2) no guarantee that they'll be interpreted the way you want by the 
>> compiler (will it interpret them as UTF-8, or ISO 8859/1, or some other 
>> ISO 8859/x, or some EUC double-byte character set, or some Windows code 
>> page, or...?).
>>
>>   
> Excuse my little englander ignorance, but is the problem is occurring 
> because the files have characters from outside the 7 bit ASCII character 
> set?  If this is correct we should add a suitable entry to README.developer.
> 
> It would be nice if there was an automated way of checking this (apart 
> from using the MS compiler) for all committed files.
> 
> -- 
> Regards,
> 
> Graham Bloice
> 
> _______________________________________________
> Wireshark-dev mailing list
> Wireshark-dev@xxxxxxxxxxxxx
> http://www.wireshark.org/mailman/listinfo/wireshark-dev
>