Page Speed Optimization Libraries
1.5.27.2
|
00001 /* 00002 * Copyright 2012 Google Inc. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http:///www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 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_