VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/share/emscripten/tests/poppler/poppler/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/emscripten/tests/poppler/poppler/gen-unicode-tables.py
UNICODE_LAST_CHAR_PART1 = 0x2FAFF
HANGUL_S_BASE = 0xAC00
HANGUL_S_COUNT = 19 * 21 * 28
import unicodedata

print """// Generated by gen-unicode-tables.py

typedef struct {
  Unicode character;
  int length;
  int offset;
} decomposition;
"""

decomp_table = []
max_index = 0
decomp_expansion_index = {}
decomp_expansion = []
for u in xrange(0, UNICODE_LAST_CHAR_PART1):
	if (u >= HANGUL_S_BASE and u < HANGUL_S_BASE + HANGUL_S_COUNT):
		continue
	norm = tuple(map(ord, unicodedata.normalize("NFKD", unichr(u))))
	if norm != (u,):
		try: 
			i = decomp_expansion_index[norm]
			decomp_table.append((u, len(norm), i))
		except KeyError:
			decomp_table.append((u, len(norm), max_index))
			decomp_expansion_index[norm] = max_index
			decomp_expansion.append((norm, max_index))
			max_index += len(norm)
print "#define DECOMP_TABLE_LENGTH %d\n" % len(decomp_table)
print "static const decomposition decomp_table[] = {\n%s\n};\n" % ", \n".join(
		"  { 0x%x, %d, %d }" % (character, length, offset)
		for character, length, offset in decomp_table)
print "static const Unicode decomp_expansion[] = {\n%s\n};\n" % ", \n".join(
		"  %s /* offset %d */ " % (", ".join("0x%x" % u for u in norm), 
			index) for norm, index in decomp_expansion)

VaKeR 2022