diff -r 000000000000 -r 6474c204b198 intl/uconv/ucvcn/cp936invmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/intl/uconv/ucvcn/cp936invmap.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,2684 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* This file is generated by the following C snippet, which depends on + * cp936map.h. It maps Unicode to GBK. */ + +/* +#include +#include +#include +#include + +#define MAX_GBK_LENGTH 24066 // (0xfe-0x80)*(0xfe-0x3f) +#define UNICHAR_IN_RANGE(a, b, c) \ + (((uint16_t)(a) <= (uint16_t)(b))&&((uint16_t)(b) <= (uint16_t)(c))) + +static const uint16_t gGBKToUnicodeTable[MAX_GBK_LENGTH] = { +#include "cp936map.h" +}; + +static uint16_t gUnicodeToGBKTable[0xA000-0x4e00]; + +int main() +{ + uint16_t unicode; + uint16_t i; + // zap it to zero first + memset(gUnicodeToGBKTable,0, sizeof(gUnicodeToGBKTable)); + + for ( i=0; i