Exemple #1
0
/**
 * hook_macwin:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between maccyr and cp1251 charsets for language "be".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_macwin(EncaAnalyserState *analyser)
{
  static const unsigned char list_maccyr[] = {
    0xb4, 0xdf, 0xd9, 0xde, 0x80, 0x8d, 0x91, 0x8f, 0x81
  };
  static const unsigned char list_cp1251[] = {
    0xb3, 0xff, 0xa2, 0xb8, 0xc0, 0xcd, 0xd1, 0xcf, 0xc1
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(maccyr),
    MAKE_HOOK_LINE(cp1251),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
Exemple #2
0
/**
 * hook_iso1250:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between iso8859-2 and cp1250 charsets for language "hr".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_iso1250(EncaAnalyserState *analyser)
{
  static const unsigned char list_iso88592[] = {
    0xb9, 0xbe, 0xa9, 0xae
  };
  static const unsigned char list_cp1250[] = {
    0x9a, 0x9e, 0x8a, 0x8e
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(iso88592),
    MAKE_HOOK_LINE(cp1250),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
Exemple #3
0
/**
 * hook_855866:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between cp866 and ibm855 charsets for language "be".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_855866(EncaAnalyserState *analyser)
{
  static const unsigned char list_ibm855[] = {
    0xd4, 0xd0, 0xd6, 0x8a, 0xc6, 0xde, 0xd2, 0xf3, 0xd8, 0x98, 0xf1
  };
  static const unsigned char list_ibm866[] = {
    0xad, 0xe0, 0xa5, 0xab, 0xae, 0xaa, 0xe2, 0xef, 0xa7, 0xaf, 0xe6
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(ibm855),
    MAKE_HOOK_LINE(ibm866),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
Exemple #4
0
/**
 * hook_isokoi:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between iso8859-5 and koi8u charsets for language "be".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_isokoi(EncaAnalyserState *analyser)
{
  static const unsigned char list_iso88595[] = {
    0xdd, 0xd0, 0xe0, 0xf6, 0xeb, 0xef, 0xe3, 0xe2, 0xe1, 0xdf
  };
  static const unsigned char list_koi8u[] = {
    0xc1, 0xce, 0xc5, 0xcc, 0xcb, 0xcf, 0xa6, 0xc4, 0xcd, 0xae
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(iso88595),
    MAKE_HOOK_LINE(koi8u),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
Exemple #5
0
/**
 * hook_lat4balt:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between iso8859-4 and baltic charsets for language "lt".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_lat4balt(EncaAnalyserState *analyser)
{
  static const unsigned char list_iso88594[] = {
    0xec, 0xb9, 0xbe, 0xb1, 0xfe, 0xe8, 0xa9, 0xae, 0xc8
  };
  static const unsigned char list_baltic[] = {
    0xe1, 0xf8, 0xe6, 0xe0, 0xfb, 0xeb, 0xd9, 0xca, 0xc0
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(iso88594),
    MAKE_HOOK_LINE(baltic),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
Exemple #6
0
/**
 * hook_baltwin:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between cp1257, iso8859-13 and baltic charsets for language "lt".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_baltwin(EncaAnalyserState *analyser)
{
  static const unsigned char list_cp1257[] = {
    0xf0, 0xfe, 0xeb, 0xe8, 0xd0, 0xde, 0xc8
  };
  static const unsigned char list_iso885913[] = {
    0xf0, 0xfe, 0xeb, 0xe8, 0xd0, 0xde, 0xc8
  };
  static const unsigned char list_baltic[] = {
    0xf9, 0xea, 0xe7, 0xd9, 0xca, 0xc7, 0xc0
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(cp1257),
    MAKE_HOOK_LINE(iso885913),
    MAKE_HOOK_LINE(baltic),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}
Exemple #7
0
/**
 * hook_isocork:
 * @analyser: Analyser state whose charset ratings are to be modified.
 *
 * Decides between iso8859-2, cp1250 and cork charsets for language "hu".
 *
 * Returns: Nonzero if charset ratigns have been actually modified, zero
 * otherwise.
 **/
static int
hook_isocork(EncaAnalyserState *analyser)
{
  static const unsigned char list_iso88592[] = {
    0xf5, 0xfb, 0xd5
  };
  static const unsigned char list_cp1250[] = {
    0xf5, 0xfb, 0xd5
  };
  static const unsigned char list_cork[] = {
    0xae, 0xb6, 0x8e
  };
  static EncaLanguageHookData1CS hookdata[] = {
    MAKE_HOOK_LINE(iso88592),
    MAKE_HOOK_LINE(cp1250),
    MAKE_HOOK_LINE(cork),
  };

  return enca_language_hook_ncs(analyser, ELEMENTS(hookdata), hookdata);
}