michael@0: /* michael@0: * %W% %E% michael@0: * michael@0: * (C) Copyright IBM Corp. 2001 - All Rights Reserved michael@0: * michael@0: */ michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "unicode/uscript.h" michael@0: michael@0: #include "scrptrun.h" michael@0: michael@0: #include michael@0: michael@0: UChar testChars[] = { michael@0: 0x0020, 0x0946, 0x0939, 0x093F, 0x0928, 0x094D, 0x0926, 0x0940, 0x0020, michael@0: 0x0627, 0x0644, 0x0639, 0x0631, 0x0628, 0x064A, 0x0629, 0x0020, michael@0: 0x0420, 0x0443, 0x0441, 0x0441, 0x043A, 0x0438, 0x0439, 0x0020, michael@0: 'E', 'n', 'g', 'l', 'i', 's', 'h', 0x0020, michael@0: 0x6F22, 0x5B75, 0x3068, 0x3072, 0x3089, 0x304C, 0x306A, 0x3068, michael@0: 0x30AB, 0x30BF, 0x30AB, 0x30CA, michael@0: 0xD801, 0xDC00, 0xD801, 0xDC01, 0xD801, 0xDC02, 0xD801, 0xDC03 michael@0: }; michael@0: michael@0: int32_t testLength = sizeof testChars / sizeof testChars[0]; michael@0: michael@0: void main() michael@0: { michael@0: ScriptRun scriptRun(testChars, 0, testLength); michael@0: michael@0: while (scriptRun.next()) { michael@0: int32_t start = scriptRun.getScriptStart(); michael@0: int32_t end = scriptRun.getScriptEnd(); michael@0: UScriptCode code = scriptRun.getScriptCode(); michael@0: michael@0: printf("Script '%s' from %d to %d.\n", uscript_getName(code), start, end); michael@0: } michael@0: }