00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00022
00023 #ifndef NET_INSTAWEB_UTIL_PUBLIC_CHARSET_UTIL_H_
00024 #define NET_INSTAWEB_UTIL_PUBLIC_CHARSET_UTIL_H_
00025
00026 #include "net/instaweb/util/public/string_util.h"
00027
00028 namespace net_instaweb {
00029
00031 const char kUtf8Charset[] = "utf-8";
00032 const char kUtf16BigEndianCharset[] = "utf-16be";
00033 const char kUtf16LittleEndianCharset[] = "utf-16le";
00034 const char kUtf32BigEndianCharset[] = "utf-32be";
00035 const char kUtf32LittleEndianCharset[] = "utf-32le";
00036
00038 const char kUtf8Bom[] = "\xEF\xBB\xBF";
00039 const char kUtf16BigEndianBom[] = "\xFE\xFF";
00040 const char kUtf16LittleEndianBom[] = "\xFF\xFE";
00041 const char kUtf32BigEndianBom[] = "\x00\x00\xFE\xFF";
00042 const char kUtf32LittleEndianBom[] = "\xFF\xFE\x00\x00";
00043
00061 bool StripUtf8Bom(StringPiece* contents);
00062
00066 const StringPiece GetCharsetForBom(const StringPiece contents);
00067
00068 }
00069
00070 #endif ///< NET_INSTAWEB_UTIL_PUBLIC_CHARSET_UTIL_H_