• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 ////////////////////////////////////////////////////////////////////////////////
16 
17 #ifndef COMPACT_ENC_DET_COMPACT_ENC_DET_HINT_CODE_H_
18 #define COMPACT_ENC_DET_COMPACT_ENC_DET_HINT_CODE_H_
19 
20 #include <string>                        // for string
21 
22 #include "util/basictypes.h"             // for uint32
23 #include "util/encodings/encodings.h"    // for Encoding
24 
25 using std::string;
26 
27 // Return name for extended encoding
28 const char* MyEncodingName(Encoding enc);
29 
30 // Normalize ASCII string to first 4 alphabetic chars and last 4 digit chars
31 // Letters are forced to lowercase ASCII
32 // Used to normalize charset= values
33 string MakeChar44(const string& str);
34 
35 // Normalize ASCII string to first 4 alphabetic/digit chars
36 // Letters are forced to lowercase ASCII
37 // Used to normalize TLD values
38 string MakeChar4(const string& str);
39 
40 // Normalize ASCII string to first 8 alphabetic/digit chars
41 // Letters are forced to lowercase ASCII
42 // Used to normalize other values
43 string MakeChar8(const string& str);
44 
45 #endif  // COMPACT_ENC_DET_COMPACT_ENC_DET_HINT_CODE_H_
46