예제 #1
0
파일: euc_jp.c 프로젝트: johndpope/etoile
static int
code_to_mbclen(OnigCodePoint code)
{
  if (ONIGENC_IS_CODE_ASCII(code)) return 1;
  else if ((code & 0xff0000) != 0) return 3;
  else if ((code &   0xff00) != 0) return 2;
  else return 0;
}
예제 #2
0
파일: euc_jp.c 프로젝트: Jin-chan/Onigmo
static int
code_to_mbclen(OnigCodePoint code)
{
  if (ONIGENC_IS_CODE_ASCII(code)) return 1;
  else if ((code & 0xff808080) == 0x00808080) return 3;
  else if ((code & 0xffff8080) == 0x00008080) return 2;
  else
    return ONIGERR_INVALID_CODE_POINT_VALUE;
}
예제 #3
0
파일: euc_jp.c 프로젝트: 217/ruby
static int
code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
{
  if (ONIGENC_IS_CODE_ASCII(code)) return 1;
  else if (code > 0xffffff) return 0;
  else if ((code & 0xff0000) >= 0x800000) return 3;
  else if ((code &   0xff00) >= 0x8000) return 2;
  else
    return ONIGERR_INVALID_CODE_POINT_VALUE;
}
예제 #4
0
파일: euc_jp.c 프로젝트: DashYang/sim
static int
code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
{
  if (ONIGENC_IS_CODE_ASCII(code)) return 1;
  else if (code > 0x00ffffff)
    return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
  else if ((code & 0xff808080) == 0x00808080) return 3;
  else if ((code & 0xffff8080) == 0x00008080) return 2;
  else
    return ONIGERR_INVALID_CODE_POINT_VALUE;
}
예제 #5
0
  Object* Character::ascii_p(STATE) {
    bool found;
    int c = codepoint(state, &found);

    return RBOOL(found && ONIGENC_IS_CODE_ASCII(c));
  }