symbian-qemu-0.9.1-12/python-2.6.1/Modules/cjkcodecs/alg_jisx0201.h
author Mike Kinghan <mikek@symbian.org>
Wed, 04 Aug 2010 15:41:26 +0100
branchGCC_SURGE
changeset 95 285922d13199
parent 1 2fb8b9db1c86
permissions -rw-r--r--
Correction for the fix for Bug 3508 - Persistent storage support breaks Linux compatibility. A 2nd `make install' will fail attempting to create symlink libnvmemmory.so already created by 1st install. Install should pre-emptively delete it.

#define JISX0201_R_ENCODE(c, assi)			\
	if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e)	\
		(assi) = (c);				\
	else if ((c) == 0x00a5) (assi) = 0x5c;		\
	else if ((c) == 0x203e) (assi) = 0x7e;
#define JISX0201_K_ENCODE(c, assi)			\
	if ((c) >= 0xff61 && (c) <= 0xff9f)		\
		(assi) = (c) - 0xfec0;
#define JISX0201_ENCODE(c, assi)			\
	JISX0201_R_ENCODE(c, assi)			\
	else JISX0201_K_ENCODE(c, assi)

#define JISX0201_R_DECODE(c, assi)			\
	if ((c) < 0x5c) (assi) = (c);			\
	else if ((c) == 0x5c) (assi) = 0x00a5;		\
	else if ((c) < 0x7e) (assi) = (c);		\
	else if ((c) == 0x7e) (assi) = 0x203e;		\
	else if ((c) == 0x7f) (assi) = 0x7f;
#define JISX0201_K_DECODE(c, assi)			\
	if ((c) >= 0xa1 && (c) <= 0xdf)			\
	(assi) = 0xfec0 + (c);
#define JISX0201_DECODE(c, assi)			\
	JISX0201_R_DECODE(c, assi)			\
	else JISX0201_K_DECODE(c, assi)