]> git.saurik.com Git - apple/icu.git/blame - icuSources/extra/scrptrun/srtest.cpp
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / extra / scrptrun / srtest.cpp
CommitLineData
b75a7d8f
A
1/*
2 * %W% %E%
3 *
2ca993e8 4 * (C) Copyright IBM Corp. 2001-2016 - All Rights Reserved
b75a7d8f
A
5 *
6 */
7
8#include "unicode/utypes.h"
9#include "unicode/uscript.h"
10
2ca993e8 11#include "cmemory.h"
b75a7d8f
A
12#include "scrptrun.h"
13
14#include <stdio.h>
15
16UChar testChars[] = {
17 0x0020, 0x0946, 0x0939, 0x093F, 0x0928, 0x094D, 0x0926, 0x0940, 0x0020,
18 0x0627, 0x0644, 0x0639, 0x0631, 0x0628, 0x064A, 0x0629, 0x0020,
19 0x0420, 0x0443, 0x0441, 0x0441, 0x043A, 0x0438, 0x0439, 0x0020,
20 'E', 'n', 'g', 'l', 'i', 's', 'h', 0x0020,
21 0x6F22, 0x5B75, 0x3068, 0x3072, 0x3089, 0x304C, 0x306A, 0x3068,
22 0x30AB, 0x30BF, 0x30AB, 0x30CA,
23 0xD801, 0xDC00, 0xD801, 0xDC01, 0xD801, 0xDC02, 0xD801, 0xDC03
24};
25
2ca993e8 26int32_t testLength = UPRV_LENGTHOF(testChars);
b75a7d8f
A
27
28void main()
29{
30 ScriptRun scriptRun(testChars, 0, testLength);
31
32 while (scriptRun.next()) {
33 int32_t start = scriptRun.getScriptStart();
34 int32_t end = scriptRun.getScriptEnd();
35 UScriptCode code = scriptRun.getScriptCode();
36
37 printf("Script '%s' from %d to %d.\n", uscript_getName(code), start, end);
38 }
2ca993e8 39}