Blame gettext-runtime/gnulib-lib/uniwidth/cjk.h

Packit 5b56b6
/* Test for CJK encoding.
Packit 5b56b6
   Copyright (C) 2001-2002, 2005-2007, 2009-2015 Free Software Foundation, Inc.
Packit 5b56b6
   Written by Bruno Haible <bruno@clisp.org>, 2002.
Packit 5b56b6
Packit 5b56b6
   This program is free software: you can redistribute it and/or modify it
Packit 5b56b6
   under the terms of the GNU General Public License as published
Packit 5b56b6
   by the Free Software Foundation; either version 3 of the License, or
Packit 5b56b6
   (at your option) any later version.
Packit 5b56b6
Packit 5b56b6
   This program is distributed in the hope that it will be useful,
Packit 5b56b6
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5b56b6
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 5b56b6
   General Public License for more details.
Packit 5b56b6
Packit 5b56b6
   You should have received a copy of the GNU General Public License
Packit 5b56b6
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 5b56b6
Packit 5b56b6
#include "streq.h"
Packit 5b56b6
Packit 5b56b6
static int
Packit 5b56b6
is_cjk_encoding (const char *encoding)
Packit 5b56b6
{
Packit 5b56b6
  if (0
Packit 5b56b6
      /* Legacy Japanese encodings */
Packit 5b56b6
      || STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)
Packit 5b56b6
      /* Legacy Chinese encodings */
Packit 5b56b6
      || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
Packit 5b56b6
      || STREQ_OPT (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0)
Packit 5b56b6
      || STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)
Packit 5b56b6
      || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)
Packit 5b56b6
      /* Legacy Korean encodings */
Packit 5b56b6
      || STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
Packit 5b56b6
      || STREQ_OPT (encoding, "CP949", 'C', 'P', '9', '4', '9', 0, 0, 0, 0)
Packit 5b56b6
      || STREQ_OPT (encoding, "JOHAB", 'J', 'O', 'H', 'A', 'B', 0, 0, 0, 0))
Packit 5b56b6
    return 1;
Packit 5b56b6
  return 0;
Packit 5b56b6
}