src/ccutil/unicharcompress.cpp
std::string UnicharCompress::GetEncodingAsString(const UNICHARSET &unicharset) const {
  std::string encoding;
  for (unsigned c = 0; c < encoder_.size(); ++c) {
    const RecodedCharID &code = encoder_[c];
    if (0 < c && c < SPECIAL_UNICHAR_CODES_COUNT && code == encoder_[c - 1]) {
      // Don't show the duplicate entry.
      continue;
    }
    encoding += std::to_string(code(0));
    for (int i = 1; i < code.length(); ++i) {
      encoding += "," + std::to_string(code(i));
    }
    encoding += "\t";
    if (c >= unicharset.size() ||
        (0 < c && c < SPECIAL_UNICHAR_CODES_COUNT && unicharset.has_special_codes())) {
      encoding += kNullChar;
    } else {
      encoding += unicharset.id_to_unichar(c);
    }
    encoding += "\n";
  }
  return encoding;
}
// Returns a string containing a text file that describes the encoding thus:
// <index>[,<index>]*<tab><UTF8-str><newline>
// In words, a comma-separated list of one or more indices, followed by a tab
// and the UTF-8 string that the code represents per line. Most simple scripts
// will encode a single index to a UTF8-string, but Chinese, Japanese, Korean
// and the Indic scripts will contain a many-to-many mapping.
// See the class comment above for details.
Returns a string containing a text file that describes the encoding thus:
[,]*
In words, a comma-separated list of one or more indices, followed by a tab
and the UTF-8 string that the code represents per line. Most simple scripts
will encode a single index to a UTF8-string, but Chinese, Japanese, Korean
and the Indic scripts will contain a many-to-many mapping.
See the class comment above for details.
Returns a string containing a text file that describes the encoding thus : [ ] * In words a comma - separated list of one or more indices followed by a tab and the UTF - 8 string that the code represents per line . Most simple scripts will encode a single index to a UTF8 - string but Chinese Japanese Korean and the Indic scripts will contain a many - to - many mapping . See the class comment above for details .
std::string UnicharCompress::GetEncodingAsString(const UNICHARSET &unicharset) const {
  std::string encoding;
  for (unsigned c = 0; c < encoder_.size(); ++c) {
    const RecodedCharID &code = encoder_[c];
    if (0 < c && c < SPECIAL_UNICHAR_CODES_COUNT && code == encoder_[c - 1]) {
      continue;
    }
    encoding += std::to_string(code(0));
    for (int i = 1; i < code.length(); ++i) {
      encoding += "," + std::to_string(code(i));
    }
    encoding += "\t";
    if (c >= unicharset.size() ||
        (0 < c && c < SPECIAL_UNICHAR_CODES_COUNT && unicharset.has_special_codes())) {
      encoding += kNullChar;
    } else {
      encoding += unicharset.id_to_unichar(c);
    }
    encoding += "\n";
  }
  return encoding;
}
std :: string UnicharCompress :: GetEncodingAsString ( const UNICHARSET & unicharset ) const { std :: string encoding ; for ( unsigned c = 0 ; c < encoder_ . size ( ) ; ++ c ) { const RecodedCharID & code = encoder_ [ c ] ; if ( 0 < c && c < SPECIAL_UNICHAR_CODES_COUNT && code == encoder_ [ c - 1 ] ) { continue ; } encoding += std :: to_string ( code ( 0 ) ) ; for ( int i = 1 ; i < code . length ( ) ; ++ i ) { encoding += " " + std :: to_string ( code ( i ) ) ; } encoding += " \t " ; if ( c >= unicharset . size ( ) || ( 0 < c && c < SPECIAL_UNICHAR_CODES_COUNT && unicharset . has_special_codes ( ) ) ) { encoding += kNullChar ; } else { encoding += unicharset . id_to_unichar ( c ) ; } encoding += " \n " ; } return encoding ; }
Returns a string containing a text file that describes the encoding thus:
<index>[,<index>]*<tab><UTF8-str><newline>
In words, a comma-separated list of one or more indices, followed by a tab
and the UTF-8 string that the code represents per line.
Returns a string containing a text file that describes the encoding thus : <index > [ <index > ] * <tab > <UTF8 - str > <newline > In words a comma - separated list of one or more indices followed by a tab and the UTF - 8 string that the code represents per line .
// Don't show the duplicate entry.