2001-10-17 21:17:16 +00:00
|
|
|
/*
|
|
|
|
* %W% %E%
|
|
|
|
*
|
2016-02-23 10:40:09 +00:00
|
|
|
* (C) Copyright IBM Corp. 2001-2016 - All Rights Reserved
|
2001-10-17 21:17:16 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2001-11-27 01:35:15 +00:00
|
|
|
#include "unicode/utypes.h"
|
2001-10-17 21:17:16 +00:00
|
|
|
#include "unicode/uscript.h"
|
|
|
|
|
2016-02-23 10:40:09 +00:00
|
|
|
#include "cmemory.h"
|
2001-10-17 21:17:16 +00:00
|
|
|
#include "scrptrun.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2001-11-27 01:35:15 +00:00
|
|
|
UChar testChars[] = {
|
2001-10-17 21:17:16 +00:00
|
|
|
0x0020, 0x0946, 0x0939, 0x093F, 0x0928, 0x094D, 0x0926, 0x0940, 0x0020,
|
|
|
|
0x0627, 0x0644, 0x0639, 0x0631, 0x0628, 0x064A, 0x0629, 0x0020,
|
|
|
|
0x0420, 0x0443, 0x0441, 0x0441, 0x043A, 0x0438, 0x0439, 0x0020,
|
|
|
|
'E', 'n', 'g', 'l', 'i', 's', 'h', 0x0020,
|
|
|
|
0x6F22, 0x5B75, 0x3068, 0x3072, 0x3089, 0x304C, 0x306A, 0x3068,
|
|
|
|
0x30AB, 0x30BF, 0x30AB, 0x30CA,
|
|
|
|
0xD801, 0xDC00, 0xD801, 0xDC01, 0xD801, 0xDC02, 0xD801, 0xDC03
|
|
|
|
};
|
|
|
|
|
2016-02-23 10:40:09 +00:00
|
|
|
int32_t testLength = UPRV_LENGTHOF(testChars);
|
2001-10-17 21:17:16 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
ScriptRun scriptRun(testChars, 0, testLength);
|
|
|
|
|
|
|
|
while (scriptRun.next()) {
|
2001-11-27 01:35:15 +00:00
|
|
|
int32_t start = scriptRun.getScriptStart();
|
|
|
|
int32_t end = scriptRun.getScriptEnd();
|
|
|
|
UScriptCode code = scriptRun.getScriptCode();
|
2001-10-17 21:17:16 +00:00
|
|
|
|
2002-04-02 01:17:28 +00:00
|
|
|
printf("Script '%s' from %d to %d.\n", uscript_getName(code), start, end);
|
|
|
|
}
|
2016-02-23 10:40:09 +00:00
|
|
|
}
|