/* -*- 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