From 2a6bc212d48dbab2320be7d7ba3bce4355287df4 Mon Sep 17 00:00:00 2001
From: Fredrik Roubert
Date: Tue, 19 Mar 2024 16:34:06 +0100
Subject: [PATCH] ICU-22691 Delete abandoned sample code.
---
icu4c/source/allinone/allinone.sln | 36 -
icu4c/source/common/unicode/ucnv.h | 3 -
icu4c/source/configure.ac | 3 +-
icu4c/source/i18n/unicode/dtitvfmt.h | 10 -
icu4c/source/i18n/unicode/dtptngen.h | 15 -
icu4c/source/i18n/unicode/plurfmt.h | 5 -
icu4c/source/samples/Makefile.in | 4 +-
icu4c/source/samples/all/all.sln | 208 ---
icu4c/source/samples/all/samplecheck.bat | 155 ---
icu4c/source/samples/break/Makefile | 25 -
icu4c/source/samples/break/break.cpp | 150 ---
icu4c/source/samples/break/break.sln | 25 -
icu4c/source/samples/break/break.vcxproj | 153 ---
.../samples/break/break.vcxproj.filters | 25 -
icu4c/source/samples/break/readme.txt | 63 -
icu4c/source/samples/break/ubreak.c | 134 --
icu4c/source/samples/cal/Makefile.in | 78 --
icu4c/source/samples/cal/cal.c | 766 -----------
icu4c/source/samples/cal/cal.sln | 25 -
icu4c/source/samples/cal/cal.vcxproj | 157 ---
icu4c/source/samples/cal/cal.vcxproj.filters | 30 -
icu4c/source/samples/cal/readme.txt | 61 -
icu4c/source/samples/cal/uprint.c | 80 --
icu4c/source/samples/cal/uprint.h | 30 -
icu4c/source/samples/case/Makefile | 27 -
icu4c/source/samples/case/case.cpp | 92 --
icu4c/source/samples/case/case.sln | 25 -
icu4c/source/samples/case/case.vcxproj | 151 ---
.../source/samples/case/case.vcxproj.filters | 25 -
icu4c/source/samples/case/readme.txt | 64 -
icu4c/source/samples/case/ucase.c | 94 --
icu4c/source/samples/citer/Makefile | 25 -
icu4c/source/samples/citer/citer.cpp | 206 ---
icu4c/source/samples/citer/citer.vcxproj | 121 --
.../samples/citer/citer.vcxproj.filters | 22 -
icu4c/source/samples/citer/readme.txt | 63 -
icu4c/source/samples/csdet/Makefile | 25 -
icu4c/source/samples/csdet/csdet.c | 77 --
icu4c/source/samples/csdet/csdet.vcxproj | 128 --
.../samples/csdet/csdet.vcxproj.filters | 22 -
icu4c/source/samples/csdet/readme.txt | 63 -
icu4c/source/samples/date/Makefile.in | 78 --
icu4c/source/samples/date/date.c | 357 -----
icu4c/source/samples/date/date.sln | 25 -
icu4c/source/samples/date/date.vcxproj | 154 ---
.../source/samples/date/date.vcxproj.filters | 30 -
icu4c/source/samples/date/readme.txt | 61 -
icu4c/source/samples/date/uprint.c | 81 --
icu4c/source/samples/date/uprint.h | 30 -
icu4c/source/samples/datecal/Makefile | 27 -
icu4c/source/samples/datecal/cal.cpp | 75 --
icu4c/source/samples/datecal/ccal.c | 61 -
icu4c/source/samples/datefmt/Makefile | 23 -
icu4c/source/samples/datefmt/README.TXT | 107 --
.../source/samples/datefmt/answers/main_0.cpp | 70 -
.../source/samples/datefmt/answers/main_1.cpp | 68 -
.../source/samples/datefmt/answers/main_2.cpp | 91 --
.../source/samples/datefmt/answers/main_3.cpp | 100 --
icu4c/source/samples/datefmt/datefmt.sln | 27 -
icu4c/source/samples/datefmt/datefmt.vcxproj | 152 ---
.../samples/datefmt/datefmt.vcxproj.filters | 25 -
icu4c/source/samples/datefmt/main.cpp | 102 --
icu4c/source/samples/datefmt/util.cpp | 69 -
icu4c/source/samples/datefmt/util.h | 22 -
icu4c/source/samples/dtitvfmtsample/Makefile | 27 -
.../samples/dtitvfmtsample/dtitvfmtsample.cpp | 144 ---
.../dtitvfmtsample/dtitvfmtsample.vcxproj | 140 --
.../dtitvfmtsample.vcxproj.filters | 22 -
icu4c/source/samples/dtptngsample/Makefile | 27 -
.../samples/dtptngsample/dtptngsample.cpp | 166 ---
.../samples/dtptngsample/dtptngsample.vcxproj | 134 --
.../dtptngsample/dtptngsample.vcxproj.filters | 22 -
icu4c/source/samples/layout/FontMap.GDI | 14 -
icu4c/source/samples/layout/FontMap.Gnome | 11 -
icu4c/source/samples/layout/FontMap.cpp | 294 -----
icu4c/source/samples/layout/FontMap.h | 73 --
.../source/samples/layout/FontTableCache.cpp | 95 --
icu4c/source/samples/layout/FontTableCache.h | 43 -
.../source/samples/layout/GDIFontInstance.cpp | 408 ------
icu4c/source/samples/layout/GDIFontInstance.h | 162 ---
icu4c/source/samples/layout/GDIFontMap.cpp | 43 -
icu4c/source/samples/layout/GDIFontMap.h | 42 -
icu4c/source/samples/layout/GDIGUISupport.cpp | 28 -
icu4c/source/samples/layout/GDIGUISupport.h | 34 -
icu4c/source/samples/layout/GUISupport.h | 32 -
.../samples/layout/GnomeFontInstance.cpp | 208 ---
.../source/samples/layout/GnomeFontInstance.h | 174 ---
icu4c/source/samples/layout/GnomeFontMap.cpp | 47 -
icu4c/source/samples/layout/GnomeFontMap.h | 44 -
.../source/samples/layout/GnomeGUISupport.cpp | 43 -
icu4c/source/samples/layout/GnomeGUISupport.h | 34 -
icu4c/source/samples/layout/LayoutSample.rc | 123 --
icu4c/source/samples/layout/Makefile.in | 110 --
.../source/samples/layout/RenderingSurface.h | 38 -
icu4c/source/samples/layout/Sample.txt | 1 -
.../layout/ScriptCompositeFontInstance.cpp | 112 --
.../layout/ScriptCompositeFontInstance.h | 188 ---
icu4c/source/samples/layout/Surface.cpp | 33 -
icu4c/source/samples/layout/Surface.h | 17 -
icu4c/source/samples/layout/UnicodeReader.cpp | 125 --
icu4c/source/samples/layout/UnicodeReader.h | 36 -
icu4c/source/samples/layout/arraymem.h | 25 -
icu4c/source/samples/layout/cgnomelayout.c | 350 -----
icu4c/source/samples/layout/clayout.c | 370 ------
icu4c/source/samples/layout/cmaps.cpp | 214 ---
icu4c/source/samples/layout/cmaps.h | 95 --
icu4c/source/samples/layout/gdiglue.cpp | 83 --
icu4c/source/samples/layout/gdiglue.h | 41 -
icu4c/source/samples/layout/gnomeglue.cpp | 81 --
icu4c/source/samples/layout/gnomeglue.h | 42 -
icu4c/source/samples/layout/gnomelayout.cpp | 343 -----
icu4c/source/samples/layout/gsupport.h | 17 -
icu4c/source/samples/layout/layout.cpp | 364 ------
icu4c/source/samples/layout/layout.sln | 25 -
icu4c/source/samples/layout/layout.vcxproj | 216 ----
.../samples/layout/layout.vcxproj.filters | 95 --
icu4c/source/samples/layout/paragraph.cpp | 289 -----
icu4c/source/samples/layout/paragraph.h | 94 --
icu4c/source/samples/layout/pflow.c | 386 ------
icu4c/source/samples/layout/pflow.h | 36 -
icu4c/source/samples/layout/readme.html | 164 ---
icu4c/source/samples/layout/resource.h | 25 -
icu4c/source/samples/layout/rsurface.cpp | 29 -
icu4c/source/samples/layout/rsurface.h | 24 -
icu4c/source/samples/layout/sfnt.h | 225 ----
icu4c/source/samples/layout/ucreader.cpp | 23 -
icu4c/source/samples/layout/ucreader.h | 22 -
icu4c/source/samples/legacy/Makefile | 88 --
icu4c/source/samples/legacy/README | 44 -
icu4c/source/samples/legacy/legacy.cpp | 116 --
icu4c/source/samples/legacy/legacy.sln | 27 -
icu4c/source/samples/legacy/legacy.vcxproj | 238 ----
.../samples/legacy/legacy.vcxproj.filters | 28 -
icu4c/source/samples/legacy/newcol.cpp | 96 --
icu4c/source/samples/legacy/oldcol.cpp | 113 --
icu4c/source/samples/msgfmt/Makefile | 25 -
icu4c/source/samples/msgfmt/README.TXT | 98 --
.../source/samples/msgfmt/answers/main_0.cpp | 30 -
.../source/samples/msgfmt/answers/main_1.cpp | 28 -
.../source/samples/msgfmt/answers/main_2.cpp | 50 -
.../source/samples/msgfmt/answers/main_3.cpp | 50 -
icu4c/source/samples/msgfmt/main.cpp | 50 -
icu4c/source/samples/msgfmt/msgfmt.sln | 25 -
icu4c/source/samples/msgfmt/msgfmt.vcxproj | 155 ---
.../samples/msgfmt/msgfmt.vcxproj.filters | 25 -
icu4c/source/samples/msgfmt/util.cpp | 69 -
icu4c/source/samples/msgfmt/util.h | 22 -
icu4c/source/samples/numfmt/Makefile | 25 -
icu4c/source/samples/numfmt/capi.c | 81 --
icu4c/source/samples/numfmt/main.cpp | 276 ----
icu4c/source/samples/numfmt/numfmt.sln | 25 -
icu4c/source/samples/numfmt/numfmt.vcxproj | 160 ---
.../samples/numfmt/numfmt.vcxproj.filters | 33 -
icu4c/source/samples/numfmt/readme.txt | 64 -
icu4c/source/samples/numfmt/util.cpp | 131 --
icu4c/source/samples/numfmt/util.h | 30 -
icu4c/source/samples/plurfmtsample/Makefile | 27 -
.../samples/plurfmtsample/plurfmtsample.cpp | 105 --
.../plurfmtsample/plurfmtsample.vcxproj | 133 --
.../plurfmtsample.vcxproj.filters | 22 -
icu4c/source/samples/props/Makefile | 25 -
icu4c/source/samples/props/props.cpp | 74 --
icu4c/source/samples/props/props.sln | 25 -
icu4c/source/samples/props/props.vcxproj | 173 ---
.../samples/props/props.vcxproj.filters | 22 -
icu4c/source/samples/props/readme.txt | 62 -
icu4c/source/samples/readme.txt | 45 -
icu4c/source/samples/uciter8/Makefile | 23 -
icu4c/source/samples/uciter8/readme.txt | 76 --
icu4c/source/samples/uciter8/uciter8.c | 364 ------
icu4c/source/samples/uciter8/uciter8.sln | 25 -
icu4c/source/samples/uciter8/uciter8.vcxproj | 154 ---
.../samples/uciter8/uciter8.vcxproj.filters | 30 -
icu4c/source/samples/uciter8/uit_len8.c | 562 --------
icu4c/source/samples/uciter8/uit_len8.h | 35 -
icu4c/source/samples/ucnv/Makefile | 26 -
icu4c/source/samples/ucnv/convsamp.cpp | 1144 -----------------
icu4c/source/samples/ucnv/data01.txt | 15 -
icu4c/source/samples/ucnv/data02.bin | 1 -
icu4c/source/samples/ucnv/data06.txt | 96 --
icu4c/source/samples/ucnv/flagcb.c | 292 -----
icu4c/source/samples/ucnv/flagcb.h | 63 -
icu4c/source/samples/ucnv/readme.txt | 69 -
icu4c/source/samples/ucnv/ucnv.sln | 25 -
icu4c/source/samples/ucnv/ucnv.vcxproj | 154 ---
.../source/samples/ucnv/ucnv.vcxproj.filters | 30 -
icu4c/source/samples/udata/Makefile | 72 --
icu4c/source/samples/udata/reader.c | 135 --
icu4c/source/samples/udata/reader.vcxproj | 161 ---
.../samples/udata/reader.vcxproj.filters | 22 -
icu4c/source/samples/udata/readme.txt | 65 -
icu4c/source/samples/udata/udata.sln | 35 -
icu4c/source/samples/udata/writer.c | 114 --
icu4c/source/samples/udata/writer.vcxproj | 159 ---
.../samples/udata/writer.vcxproj.filters | 22 -
icu4c/source/samples/ufortune/Makefile | 58 -
icu4c/source/samples/ufortune/fortunedefs.mk | 43 -
icu4c/source/samples/ufortune/readme.txt | 69 -
.../samples/ufortune/resources/Makefile | 63 -
.../source/samples/ufortune/resources/es.txt | 474 -------
.../ufortune/resources/fortune_resources.mak | 57 -
.../ufortune/resources/res-file-list.txt | 2 -
.../samples/ufortune/resources/root.txt | 216 ----
icu4c/source/samples/ufortune/ufortune.c | 208 ---
icu4c/source/samples/ufortune/ufortune.sln | 25 -
.../source/samples/ufortune/ufortune.vcxproj | 96 --
.../samples/ufortune/ufortune.vcxproj.filters | 41 -
icu4c/source/samples/uresb/Makefile | 80 --
icu4c/source/samples/uresb/en.txt | 49 -
icu4c/source/samples/uresb/readme.txt | 71 -
icu4c/source/samples/uresb/resources.mak | 31 -
icu4c/source/samples/uresb/resources.vcxproj | 75 --
.../samples/uresb/resources.vcxproj.filters | 26 -
icu4c/source/samples/uresb/root.txt | 50 -
icu4c/source/samples/uresb/sr.txt | 50 -
icu4c/source/samples/uresb/uresb.c | 386 ------
icu4c/source/samples/uresb/uresb.sln | 38 -
icu4c/source/samples/uresb/uresb.vcxproj | 170 ---
.../samples/uresb/uresb.vcxproj.filters | 22 -
icu4c/source/samples/ustring/Makefile | 23 -
icu4c/source/samples/ustring/readme.txt | 63 -
icu4c/source/samples/ustring/ustring.cpp | 622 ---------
icu4c/source/samples/ustring/ustring.sln | 25 -
icu4c/source/samples/ustring/ustring.vcxproj | 151 ---
.../samples/ustring/ustring.vcxproj.filters | 22 -
225 files changed, 3 insertions(+), 22465 deletions(-)
delete mode 100644 icu4c/source/samples/break/Makefile
delete mode 100644 icu4c/source/samples/break/break.cpp
delete mode 100644 icu4c/source/samples/break/break.sln
delete mode 100644 icu4c/source/samples/break/break.vcxproj
delete mode 100644 icu4c/source/samples/break/break.vcxproj.filters
delete mode 100644 icu4c/source/samples/break/readme.txt
delete mode 100644 icu4c/source/samples/break/ubreak.c
delete mode 100644 icu4c/source/samples/cal/Makefile.in
delete mode 100644 icu4c/source/samples/cal/cal.c
delete mode 100644 icu4c/source/samples/cal/cal.sln
delete mode 100644 icu4c/source/samples/cal/cal.vcxproj
delete mode 100644 icu4c/source/samples/cal/cal.vcxproj.filters
delete mode 100644 icu4c/source/samples/cal/readme.txt
delete mode 100644 icu4c/source/samples/cal/uprint.c
delete mode 100644 icu4c/source/samples/cal/uprint.h
delete mode 100644 icu4c/source/samples/case/Makefile
delete mode 100644 icu4c/source/samples/case/case.cpp
delete mode 100644 icu4c/source/samples/case/case.sln
delete mode 100644 icu4c/source/samples/case/case.vcxproj
delete mode 100644 icu4c/source/samples/case/case.vcxproj.filters
delete mode 100644 icu4c/source/samples/case/readme.txt
delete mode 100644 icu4c/source/samples/case/ucase.c
delete mode 100644 icu4c/source/samples/citer/Makefile
delete mode 100644 icu4c/source/samples/citer/citer.cpp
delete mode 100644 icu4c/source/samples/citer/citer.vcxproj
delete mode 100644 icu4c/source/samples/citer/citer.vcxproj.filters
delete mode 100644 icu4c/source/samples/citer/readme.txt
delete mode 100644 icu4c/source/samples/csdet/Makefile
delete mode 100644 icu4c/source/samples/csdet/csdet.c
delete mode 100644 icu4c/source/samples/csdet/csdet.vcxproj
delete mode 100644 icu4c/source/samples/csdet/csdet.vcxproj.filters
delete mode 100644 icu4c/source/samples/csdet/readme.txt
delete mode 100644 icu4c/source/samples/date/Makefile.in
delete mode 100644 icu4c/source/samples/date/date.c
delete mode 100644 icu4c/source/samples/date/date.sln
delete mode 100644 icu4c/source/samples/date/date.vcxproj
delete mode 100644 icu4c/source/samples/date/date.vcxproj.filters
delete mode 100644 icu4c/source/samples/date/readme.txt
delete mode 100644 icu4c/source/samples/date/uprint.c
delete mode 100644 icu4c/source/samples/date/uprint.h
delete mode 100644 icu4c/source/samples/datecal/Makefile
delete mode 100644 icu4c/source/samples/datecal/cal.cpp
delete mode 100644 icu4c/source/samples/datecal/ccal.c
delete mode 100644 icu4c/source/samples/datefmt/Makefile
delete mode 100644 icu4c/source/samples/datefmt/README.TXT
delete mode 100644 icu4c/source/samples/datefmt/answers/main_0.cpp
delete mode 100644 icu4c/source/samples/datefmt/answers/main_1.cpp
delete mode 100644 icu4c/source/samples/datefmt/answers/main_2.cpp
delete mode 100644 icu4c/source/samples/datefmt/answers/main_3.cpp
delete mode 100644 icu4c/source/samples/datefmt/datefmt.sln
delete mode 100644 icu4c/source/samples/datefmt/datefmt.vcxproj
delete mode 100644 icu4c/source/samples/datefmt/datefmt.vcxproj.filters
delete mode 100644 icu4c/source/samples/datefmt/main.cpp
delete mode 100644 icu4c/source/samples/datefmt/util.cpp
delete mode 100644 icu4c/source/samples/datefmt/util.h
delete mode 100644 icu4c/source/samples/dtitvfmtsample/Makefile
delete mode 100644 icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.cpp
delete mode 100644 icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj
delete mode 100644 icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj.filters
delete mode 100644 icu4c/source/samples/dtptngsample/Makefile
delete mode 100644 icu4c/source/samples/dtptngsample/dtptngsample.cpp
delete mode 100644 icu4c/source/samples/dtptngsample/dtptngsample.vcxproj
delete mode 100644 icu4c/source/samples/dtptngsample/dtptngsample.vcxproj.filters
delete mode 100644 icu4c/source/samples/layout/FontMap.GDI
delete mode 100644 icu4c/source/samples/layout/FontMap.Gnome
delete mode 100644 icu4c/source/samples/layout/FontMap.cpp
delete mode 100644 icu4c/source/samples/layout/FontMap.h
delete mode 100644 icu4c/source/samples/layout/FontTableCache.cpp
delete mode 100644 icu4c/source/samples/layout/FontTableCache.h
delete mode 100644 icu4c/source/samples/layout/GDIFontInstance.cpp
delete mode 100644 icu4c/source/samples/layout/GDIFontInstance.h
delete mode 100644 icu4c/source/samples/layout/GDIFontMap.cpp
delete mode 100644 icu4c/source/samples/layout/GDIFontMap.h
delete mode 100644 icu4c/source/samples/layout/GDIGUISupport.cpp
delete mode 100644 icu4c/source/samples/layout/GDIGUISupport.h
delete mode 100644 icu4c/source/samples/layout/GUISupport.h
delete mode 100644 icu4c/source/samples/layout/GnomeFontInstance.cpp
delete mode 100644 icu4c/source/samples/layout/GnomeFontInstance.h
delete mode 100644 icu4c/source/samples/layout/GnomeFontMap.cpp
delete mode 100644 icu4c/source/samples/layout/GnomeFontMap.h
delete mode 100644 icu4c/source/samples/layout/GnomeGUISupport.cpp
delete mode 100644 icu4c/source/samples/layout/GnomeGUISupport.h
delete mode 100644 icu4c/source/samples/layout/LayoutSample.rc
delete mode 100644 icu4c/source/samples/layout/Makefile.in
delete mode 100644 icu4c/source/samples/layout/RenderingSurface.h
delete mode 100644 icu4c/source/samples/layout/Sample.txt
delete mode 100644 icu4c/source/samples/layout/ScriptCompositeFontInstance.cpp
delete mode 100644 icu4c/source/samples/layout/ScriptCompositeFontInstance.h
delete mode 100644 icu4c/source/samples/layout/Surface.cpp
delete mode 100644 icu4c/source/samples/layout/Surface.h
delete mode 100644 icu4c/source/samples/layout/UnicodeReader.cpp
delete mode 100644 icu4c/source/samples/layout/UnicodeReader.h
delete mode 100644 icu4c/source/samples/layout/arraymem.h
delete mode 100644 icu4c/source/samples/layout/cgnomelayout.c
delete mode 100644 icu4c/source/samples/layout/clayout.c
delete mode 100644 icu4c/source/samples/layout/cmaps.cpp
delete mode 100644 icu4c/source/samples/layout/cmaps.h
delete mode 100644 icu4c/source/samples/layout/gdiglue.cpp
delete mode 100644 icu4c/source/samples/layout/gdiglue.h
delete mode 100644 icu4c/source/samples/layout/gnomeglue.cpp
delete mode 100644 icu4c/source/samples/layout/gnomeglue.h
delete mode 100644 icu4c/source/samples/layout/gnomelayout.cpp
delete mode 100644 icu4c/source/samples/layout/gsupport.h
delete mode 100644 icu4c/source/samples/layout/layout.cpp
delete mode 100644 icu4c/source/samples/layout/layout.sln
delete mode 100644 icu4c/source/samples/layout/layout.vcxproj
delete mode 100644 icu4c/source/samples/layout/layout.vcxproj.filters
delete mode 100644 icu4c/source/samples/layout/paragraph.cpp
delete mode 100644 icu4c/source/samples/layout/paragraph.h
delete mode 100644 icu4c/source/samples/layout/pflow.c
delete mode 100644 icu4c/source/samples/layout/pflow.h
delete mode 100644 icu4c/source/samples/layout/readme.html
delete mode 100644 icu4c/source/samples/layout/resource.h
delete mode 100644 icu4c/source/samples/layout/rsurface.cpp
delete mode 100644 icu4c/source/samples/layout/rsurface.h
delete mode 100644 icu4c/source/samples/layout/sfnt.h
delete mode 100644 icu4c/source/samples/layout/ucreader.cpp
delete mode 100644 icu4c/source/samples/layout/ucreader.h
delete mode 100644 icu4c/source/samples/legacy/Makefile
delete mode 100644 icu4c/source/samples/legacy/README
delete mode 100644 icu4c/source/samples/legacy/legacy.cpp
delete mode 100644 icu4c/source/samples/legacy/legacy.sln
delete mode 100644 icu4c/source/samples/legacy/legacy.vcxproj
delete mode 100644 icu4c/source/samples/legacy/legacy.vcxproj.filters
delete mode 100644 icu4c/source/samples/legacy/newcol.cpp
delete mode 100644 icu4c/source/samples/legacy/oldcol.cpp
delete mode 100644 icu4c/source/samples/msgfmt/Makefile
delete mode 100644 icu4c/source/samples/msgfmt/README.TXT
delete mode 100644 icu4c/source/samples/msgfmt/answers/main_0.cpp
delete mode 100644 icu4c/source/samples/msgfmt/answers/main_1.cpp
delete mode 100644 icu4c/source/samples/msgfmt/answers/main_2.cpp
delete mode 100644 icu4c/source/samples/msgfmt/answers/main_3.cpp
delete mode 100644 icu4c/source/samples/msgfmt/main.cpp
delete mode 100644 icu4c/source/samples/msgfmt/msgfmt.sln
delete mode 100644 icu4c/source/samples/msgfmt/msgfmt.vcxproj
delete mode 100644 icu4c/source/samples/msgfmt/msgfmt.vcxproj.filters
delete mode 100644 icu4c/source/samples/msgfmt/util.cpp
delete mode 100644 icu4c/source/samples/msgfmt/util.h
delete mode 100644 icu4c/source/samples/numfmt/Makefile
delete mode 100644 icu4c/source/samples/numfmt/capi.c
delete mode 100644 icu4c/source/samples/numfmt/main.cpp
delete mode 100644 icu4c/source/samples/numfmt/numfmt.sln
delete mode 100644 icu4c/source/samples/numfmt/numfmt.vcxproj
delete mode 100644 icu4c/source/samples/numfmt/numfmt.vcxproj.filters
delete mode 100644 icu4c/source/samples/numfmt/readme.txt
delete mode 100644 icu4c/source/samples/numfmt/util.cpp
delete mode 100644 icu4c/source/samples/numfmt/util.h
delete mode 100644 icu4c/source/samples/plurfmtsample/Makefile
delete mode 100644 icu4c/source/samples/plurfmtsample/plurfmtsample.cpp
delete mode 100644 icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj
delete mode 100644 icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj.filters
delete mode 100644 icu4c/source/samples/props/Makefile
delete mode 100644 icu4c/source/samples/props/props.cpp
delete mode 100644 icu4c/source/samples/props/props.sln
delete mode 100644 icu4c/source/samples/props/props.vcxproj
delete mode 100644 icu4c/source/samples/props/props.vcxproj.filters
delete mode 100644 icu4c/source/samples/props/readme.txt
delete mode 100644 icu4c/source/samples/uciter8/Makefile
delete mode 100644 icu4c/source/samples/uciter8/readme.txt
delete mode 100644 icu4c/source/samples/uciter8/uciter8.c
delete mode 100644 icu4c/source/samples/uciter8/uciter8.sln
delete mode 100644 icu4c/source/samples/uciter8/uciter8.vcxproj
delete mode 100644 icu4c/source/samples/uciter8/uciter8.vcxproj.filters
delete mode 100644 icu4c/source/samples/uciter8/uit_len8.c
delete mode 100644 icu4c/source/samples/uciter8/uit_len8.h
delete mode 100644 icu4c/source/samples/ucnv/Makefile
delete mode 100644 icu4c/source/samples/ucnv/convsamp.cpp
delete mode 100644 icu4c/source/samples/ucnv/data01.txt
delete mode 100644 icu4c/source/samples/ucnv/data02.bin
delete mode 100644 icu4c/source/samples/ucnv/data06.txt
delete mode 100644 icu4c/source/samples/ucnv/flagcb.c
delete mode 100644 icu4c/source/samples/ucnv/flagcb.h
delete mode 100644 icu4c/source/samples/ucnv/readme.txt
delete mode 100644 icu4c/source/samples/ucnv/ucnv.sln
delete mode 100644 icu4c/source/samples/ucnv/ucnv.vcxproj
delete mode 100644 icu4c/source/samples/ucnv/ucnv.vcxproj.filters
delete mode 100644 icu4c/source/samples/udata/Makefile
delete mode 100644 icu4c/source/samples/udata/reader.c
delete mode 100644 icu4c/source/samples/udata/reader.vcxproj
delete mode 100644 icu4c/source/samples/udata/reader.vcxproj.filters
delete mode 100644 icu4c/source/samples/udata/readme.txt
delete mode 100644 icu4c/source/samples/udata/udata.sln
delete mode 100644 icu4c/source/samples/udata/writer.c
delete mode 100644 icu4c/source/samples/udata/writer.vcxproj
delete mode 100644 icu4c/source/samples/udata/writer.vcxproj.filters
delete mode 100644 icu4c/source/samples/ufortune/Makefile
delete mode 100644 icu4c/source/samples/ufortune/fortunedefs.mk
delete mode 100644 icu4c/source/samples/ufortune/readme.txt
delete mode 100644 icu4c/source/samples/ufortune/resources/Makefile
delete mode 100644 icu4c/source/samples/ufortune/resources/es.txt
delete mode 100644 icu4c/source/samples/ufortune/resources/fortune_resources.mak
delete mode 100644 icu4c/source/samples/ufortune/resources/res-file-list.txt
delete mode 100644 icu4c/source/samples/ufortune/resources/root.txt
delete mode 100644 icu4c/source/samples/ufortune/ufortune.c
delete mode 100644 icu4c/source/samples/ufortune/ufortune.sln
delete mode 100644 icu4c/source/samples/ufortune/ufortune.vcxproj
delete mode 100644 icu4c/source/samples/ufortune/ufortune.vcxproj.filters
delete mode 100644 icu4c/source/samples/uresb/Makefile
delete mode 100644 icu4c/source/samples/uresb/en.txt
delete mode 100644 icu4c/source/samples/uresb/readme.txt
delete mode 100644 icu4c/source/samples/uresb/resources.mak
delete mode 100644 icu4c/source/samples/uresb/resources.vcxproj
delete mode 100644 icu4c/source/samples/uresb/resources.vcxproj.filters
delete mode 100644 icu4c/source/samples/uresb/root.txt
delete mode 100644 icu4c/source/samples/uresb/sr.txt
delete mode 100644 icu4c/source/samples/uresb/uresb.c
delete mode 100644 icu4c/source/samples/uresb/uresb.sln
delete mode 100644 icu4c/source/samples/uresb/uresb.vcxproj
delete mode 100644 icu4c/source/samples/uresb/uresb.vcxproj.filters
delete mode 100644 icu4c/source/samples/ustring/Makefile
delete mode 100644 icu4c/source/samples/ustring/readme.txt
delete mode 100644 icu4c/source/samples/ustring/ustring.cpp
delete mode 100644 icu4c/source/samples/ustring/ustring.sln
delete mode 100644 icu4c/source/samples/ustring/ustring.vcxproj
delete mode 100644 icu4c/source/samples/ustring/ustring.vcxproj.filters
diff --git a/icu4c/source/allinone/allinone.sln b/icu4c/source/allinone/allinone.sln
index 48de0977128..4db4749d045 100644
--- a/icu4c/source/allinone/allinone.sln
+++ b/icu4c/source/allinone/allinone.sln
@@ -2,12 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cal", "..\samples\cal\cal.vcxproj", "{F7659D77-09CF-4FE9-ACEE-927287AA9509}"
- ProjectSection(ProjectDependencies) = postProject
- {0178B127-6269-407D-B112-93877BB62776} = {0178B127-6269-407D-B112-93877BB62776}
- {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D} = {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cintltst", "..\test\cintltst\cintltst.vcxproj", "{3D1246AE-1B32-479B-BECA-AEFA97BE2321}"
ProjectSection(ProjectDependencies) = postProject
{0178B127-6269-407D-B112-93877BB62776} = {0178B127-6269-407D-B112-93877BB62776}
@@ -27,12 +21,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctestfw", "..\tools\ctestfw
{73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D} = {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "date", "..\samples\date\date.vcxproj", "{38B5751A-C6F9-4409-950C-F4F9DA17275F}"
- ProjectSection(ProjectDependencies) = postProject
- {0178B127-6269-407D-B112-93877BB62776} = {0178B127-6269-407D-B112-93877BB62776}
- {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D} = {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "derb", "..\tools\genrb\derb.vcxproj", "{D3065ADB-8820-4CC7-9B6C-9510833961A3}"
ProjectSection(ProjectDependencies) = postProject
{C2B04507-2521-4801-BF0D-5FD79D6D518C} = {C2B04507-2521-4801-BF0D-5FD79D6D518C}
@@ -212,18 +200,6 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|ARM.ActiveCfg = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|ARM64.ActiveCfg = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|Win32.ActiveCfg = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|Win32.Build.0 = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.ActiveCfg = Debug|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.Build.0 = Debug|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|ARM.ActiveCfg = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|ARM64.ActiveCfg = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|Win32.ActiveCfg = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|Win32.Build.0 = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.ActiveCfg = Release|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.Build.0 = Release|x64
{3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|ARM.ActiveCfg = Debug|ARM
{3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|ARM.Build.0 = Debug|ARM
{3D1246AE-1B32-479B-BECA-AEFA97BE2321}.Debug|ARM64.ActiveCfg = Debug|ARM64
@@ -272,18 +248,6 @@ Global
{ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|Win32.Build.0 = Release|Win32
{ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|x64.ActiveCfg = Release|x64
{ECA6B435-B4FA-4F9F-BF95-F451D078FC47}.Release|x64.Build.0 = Release|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|ARM.ActiveCfg = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|ARM64.ActiveCfg = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|Win32.ActiveCfg = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|Win32.Build.0 = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.ActiveCfg = Debug|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.Build.0 = Debug|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|ARM.ActiveCfg = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|ARM64.ActiveCfg = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|Win32.ActiveCfg = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|Win32.Build.0 = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.ActiveCfg = Release|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.Build.0 = Release|x64
{D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|ARM.ActiveCfg = Debug|ARM
{D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|ARM.Build.0 = Debug|ARM
{D3065ADB-8820-4CC7-9B6C-9510833961A3}.Debug|ARM64.ActiveCfg = Debug|ARM64
diff --git a/icu4c/source/common/unicode/ucnv.h b/icu4c/source/common/unicode/ucnv.h
index 20c173b6628..4a7972c95b7 100644
--- a/icu4c/source/common/unicode/ucnv.h
+++ b/icu4c/source/common/unicode/ucnv.h
@@ -344,8 +344,6 @@ ucnv_compareNames(const char *name1, const char *name2);
* other than its an alias starting with the letters "cp". Please do not
* associate any meaning to these aliases.
*
- * \snippet samples/ucnv/convsamp.cpp ucnv_open
- *
* @param converterName Name of the coded character set table.
* This may have options appended to the string.
* IANA alias character set names, IBM CCSIDs starting with "ibm-",
@@ -1986,7 +1984,6 @@ ucnv_usesFallback(const UConverter *cnv);
* instead of the input signature bytes.
*
* Usage:
- * \snippet samples/ucnv/convsamp.cpp ucnv_detectUnicodeSignature
*
* @param source The source string in which the signature should be detected.
* @param sourceLength Length of the input string, or -1 if terminated with a NUL byte.
diff --git a/icu4c/source/configure.ac b/icu4c/source/configure.ac
index 89d207bc66b..033cab2ecc2 100644
--- a/icu4c/source/configure.ac
+++ b/icu4c/source/configure.ac
@@ -1355,8 +1355,7 @@ AC_CONFIG_FILES([icudefs.mk \
test/perf/utrie2perf/Makefile \
test/perf/leperf/Makefile \
test/fuzzer/Makefile \
- samples/Makefile samples/date/Makefile \
- samples/cal/Makefile samples/layout/Makefile])
+ samples/Makefile])
AC_OUTPUT
if test -z "$PYTHON";
diff --git a/icu4c/source/i18n/unicode/dtitvfmt.h b/icu4c/source/i18n/unicode/dtitvfmt.h
index c4cac3ecb7a..7bfdf2d8a28 100644
--- a/icu4c/source/i18n/unicode/dtitvfmt.h
+++ b/icu4c/source/i18n/unicode/dtitvfmt.h
@@ -344,11 +344,6 @@ public:
* @param status output param set to success/failure code on exit
* @return a date time interval formatter which the caller owns.
* @stable ICU 4.0
- *
- *
Sample code
- * \snippet samples/dtitvfmtsample/dtitvfmtsample.cpp dtitvfmtPreDefined1
- * \snippet samples/dtitvfmtsample/dtitvfmtsample.cpp dtitvfmtPreDefined
- *
*/
static DateIntervalFormat* U_EXPORT2 createInstance(
@@ -410,11 +405,6 @@ public:
* @param status output param set to success/failure code on exit
* @return a date time interval formatter which the caller owns.
* @stable ICU 4.0
- *
- *
Sample code
- * \snippet samples/dtitvfmtsample/dtitvfmtsample.cpp dtitvfmtPreDefined1
- * \snippet samples/dtitvfmtsample/dtitvfmtsample.cpp dtitvfmtCustomized
- *
*/
static DateIntervalFormat* U_EXPORT2 createInstance(
const UnicodeString& skeleton,
diff --git a/icu4c/source/i18n/unicode/dtptngen.h b/icu4c/source/i18n/unicode/dtptngen.h
index 25ac82eec65..3d09178b228 100644
--- a/icu4c/source/i18n/unicode/dtptngen.h
+++ b/icu4c/source/i18n/unicode/dtptngen.h
@@ -211,11 +211,6 @@ public:
* @return conflicting status. The value could be UDATPG_NO_CONFLICT,
* UDATPG_BASE_CONFLICT or UDATPG_CONFLICT.
* @stable ICU 3.8
- *
- *
Sample code
- * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1
- * \snippet samples/dtptngsample/dtptngsample.cpp addPatternExample
- *
*/
UDateTimePatternConflict addPattern(const UnicodeString& pattern,
UBool override,
@@ -388,11 +383,6 @@ public:
* @return bestPattern
* The best pattern found from the given skeleton.
* @stable ICU 3.8
- *
- *
Sample code
- * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1
- * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample
- *
*/
UnicodeString getBestPattern(const UnicodeString& skeleton, UErrorCode& status);
@@ -436,11 +426,6 @@ public:
* which must not indicate a failure before the function call.
* @return pattern adjusted to match the skeleton fields widths and subtypes.
* @stable ICU 3.8
- *
- *
Sample code
- * \snippet samples/dtptngsample/dtptngsample.cpp getBestPatternExample1
- * \snippet samples/dtptngsample/dtptngsample.cpp replaceFieldTypesExample
- *
*/
UnicodeString replaceFieldTypes(const UnicodeString& pattern,
const UnicodeString& skeleton,
diff --git a/icu4c/source/i18n/unicode/plurfmt.h b/icu4c/source/i18n/unicode/plurfmt.h
index 1e3ffe99a9f..b18489d7fae 100644
--- a/icu4c/source/i18n/unicode/plurfmt.h
+++ b/icu4c/source/i18n/unicode/plurfmt.h
@@ -190,11 +190,6 @@ public:
* @param status output param set to success/failure code on exit, which
* must not indicate a failure before the function call.
* @stable ICU 4.0
- *
- *
Sample code
- * \snippet samples/plurfmtsample/plurfmtsample.cpp PluralFormatExample1
- * \snippet samples/plurfmtsample/plurfmtsample.cpp PluralFormatExample
- *
*/
PluralFormat(const Locale& locale, const PluralRules& rules, UErrorCode& status);
diff --git a/icu4c/source/samples/Makefile.in b/icu4c/source/samples/Makefile.in
index 8f2514bfd00..79ae9805da6 100644
--- a/icu4c/source/samples/Makefile.in
+++ b/icu4c/source/samples/Makefile.in
@@ -22,8 +22,8 @@ include @platform_make_fragment@
## Files to remove for 'make clean'
CLEANFILES = *~
-SUBDIRS = date cal
-ALLSUBDIRS = cal citer coll csdet date datecal ufortune uresb datefmt msgfmt numfmt props strsrch translit uciter8 ucnv udata ustring dtitvfmtsample dtptngsample plurfmtsample
+SUBDIRS =
+ALLSUBDIRS = coll strsrch translit
## List of phony targets
.PHONY : all all-local all-recursive install install-local \
diff --git a/icu4c/source/samples/all/all.sln b/icu4c/source/samples/all/all.sln
index fb4f726e412..35e0a8d5dcb 100644
--- a/icu4c/source/samples/all/all.sln
+++ b/icu4c/source/samples/all/all.sln
@@ -2,56 +2,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "break", "..\break\break.vcxproj", "{DEEADF02-9C14-4854-A395-E505D2904D65}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cal", "..\cal\cal.vcxproj", "{F7659D77-09CF-4FE9-ACEE-927287AA9509}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "case", "..\case\case.vcxproj", "{2316BE8C-189D-4C8B-B506-9D9EE25AC46D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "date", "..\date\date.vcxproj", "{38B5751A-C6F9-4409-950C-F4F9DA17275F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datefmt", "..\datefmt\datefmt.vcxproj", "{6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msgfmt", "..\msgfmt\msgfmt.vcxproj", "{5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "numfmt", "..\numfmt\numfmt.vcxproj", "{721FBD47-E458-4C35-90DA-FF192907D5E2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "props", "..\props\props.vcxproj", "{ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reader", "..\udata\reader.vcxproj", "{BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "resources", "..\uresb\resources.vcxproj", "{69437707-2FEF-4E2C-8C3F-6E6B3D241366}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strsrch", "..\strsrch\strsrch.vcxproj", "{E97790D1-7ABE-4C8E-9627-251ABEAA3EEC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translit", "..\translit\translit.vcxproj", "{D1BEC124-303A-4F44-BA70-55769B8FE96A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uciter8", "..\uciter8\uciter8.vcxproj", "{94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ucnv", "..\ucnv\ucnv.vcxproj", "{8C95060E-61F5-464E-BB42-95B788C0D7E4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ufortune", "..\ufortune\ufortune.vcxproj", "{25F534DF-93C9-4853-A88E-DB7D8CF74042}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ugrep", "..\ugrep\ugrep.vcxproj", "{63166CEB-02CC-472C-B3B7-E6C559939BDA}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uresb", "..\uresb\uresb.vcxproj", "{92580BF4-F4DA-4024-B3F8-444F982BC72F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ustring", "..\ustring\ustring.vcxproj", "{FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "writer", "..\udata\writer.vcxproj", "{40A90302-F173-4629-A003-F571D2D93D16}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "citer", "..\citer\citer.vcxproj", "{247E2681-6C84-408B-B40C-5DB50BC5E18F}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "coll", "..\coll\coll.vcxproj", "{7664D0D2-0263-4BFB-AE19-9A1CAD231440}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csdet", "..\csdet\csdet.vcxproj", "{683745AD-3BC2-4B89-898B-93490D7F2757}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dtitvfmtsample", "..\dtitvfmtsample\dtitvfmtsample.vcxproj", "{8945255B-473B-4C47-9425-E92384338CAA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plurfmtsample", "..\plurfmtsample\plurfmtsample.vcxproj", "{B500B731-ED1A-4761-94ED-B22DFE25FF2B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dtptngsample", "..\dtptngsample\dtptngsample.vcxproj", "{115886F0-7DFB-4B8B-BE79-83162EE8713B}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -60,86 +18,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|x64.ActiveCfg = Debug|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|x64.Build.0 = Debug|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|x86.ActiveCfg = Debug|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|x86.Build.0 = Debug|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|x64.ActiveCfg = Release|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|x64.Build.0 = Release|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|x86.ActiveCfg = Release|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|x86.Build.0 = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.ActiveCfg = Debug|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.Build.0 = Debug|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x86.ActiveCfg = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x86.Build.0 = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.ActiveCfg = Release|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.Build.0 = Release|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x86.ActiveCfg = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x86.Build.0 = Release|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|x64.ActiveCfg = Debug|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|x64.Build.0 = Debug|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|x86.ActiveCfg = Debug|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|x86.Build.0 = Debug|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|x64.ActiveCfg = Release|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|x64.Build.0 = Release|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|x86.ActiveCfg = Release|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|x86.Build.0 = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.ActiveCfg = Debug|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.Build.0 = Debug|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x86.ActiveCfg = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x86.Build.0 = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.ActiveCfg = Release|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.Build.0 = Release|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x86.ActiveCfg = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x86.Build.0 = Release|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|x64.ActiveCfg = Debug|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|x64.Build.0 = Debug|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|x86.ActiveCfg = Debug|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|x86.Build.0 = Debug|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|x64.ActiveCfg = Release|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|x64.Build.0 = Release|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|x86.ActiveCfg = Release|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|x86.Build.0 = Release|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|x64.ActiveCfg = Debug|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|x64.Build.0 = Debug|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|x86.ActiveCfg = Debug|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|x86.Build.0 = Debug|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|x64.ActiveCfg = Release|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|x64.Build.0 = Release|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|x86.ActiveCfg = Release|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|x86.Build.0 = Release|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|x64.ActiveCfg = Debug|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|x64.Build.0 = Debug|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|x86.ActiveCfg = Debug|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|x86.Build.0 = Debug|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|x64.ActiveCfg = Release|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|x64.Build.0 = Release|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|x86.ActiveCfg = Release|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|x86.Build.0 = Release|Win32
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Debug|x64.ActiveCfg = Debug|x64
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Debug|x64.Build.0 = Debug|x64
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Debug|x86.ActiveCfg = Debug|Win32
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Debug|x86.Build.0 = Debug|Win32
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Release|x64.ActiveCfg = Release|x64
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Release|x64.Build.0 = Release|x64
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Release|x86.ActiveCfg = Release|Win32
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}.Release|x86.Build.0 = Release|Win32
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Debug|x64.ActiveCfg = Debug|x64
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Debug|x64.Build.0 = Debug|x64
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Debug|x86.ActiveCfg = Debug|Win32
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Debug|x86.Build.0 = Debug|Win32
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Release|x64.ActiveCfg = Release|x64
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Release|x64.Build.0 = Release|x64
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Release|x86.ActiveCfg = Release|Win32
- {BFEFC070-C5A9-42E3-BAAE-A51FB2C4BA28}.Release|x86.Build.0 = Release|Win32
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Debug|x64.ActiveCfg = Debug|x64
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Debug|x64.Build.0 = Debug|x64
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Debug|x86.ActiveCfg = Debug|Win32
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Debug|x86.Build.0 = Debug|Win32
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Release|x64.ActiveCfg = Release|x64
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Release|x64.Build.0 = Release|x64
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Release|x86.ActiveCfg = Release|Win32
- {69437707-2FEF-4E2C-8C3F-6E6B3D241366}.Release|x86.Build.0 = Release|Win32
{E97790D1-7ABE-4C8E-9627-251ABEAA3EEC}.Debug|x64.ActiveCfg = Debug|x64
{E97790D1-7ABE-4C8E-9627-251ABEAA3EEC}.Debug|x64.Build.0 = Debug|x64
{E97790D1-7ABE-4C8E-9627-251ABEAA3EEC}.Debug|x86.ActiveCfg = Debug|Win32
@@ -156,28 +34,6 @@ Global
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Release|x64.Build.0 = Release|x64
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Release|x86.ActiveCfg = Release|Win32
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Release|x86.Build.0 = Release|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|x64.ActiveCfg = Debug|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|x64.Build.0 = Debug|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|x86.ActiveCfg = Debug|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|x86.Build.0 = Debug|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|x64.ActiveCfg = Release|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|x64.Build.0 = Release|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|x86.ActiveCfg = Release|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|x86.Build.0 = Release|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|x64.ActiveCfg = Debug|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|x64.Build.0 = Debug|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|x86.ActiveCfg = Debug|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|x86.Build.0 = Debug|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|x64.ActiveCfg = Release|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|x64.Build.0 = Release|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|x86.ActiveCfg = Release|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|x86.Build.0 = Release|Win32
- {25F534DF-93C9-4853-A88E-DB7D8CF74042}.Debug|x64.ActiveCfg = Debug|Win32
- {25F534DF-93C9-4853-A88E-DB7D8CF74042}.Debug|x86.ActiveCfg = Debug|Win32
- {25F534DF-93C9-4853-A88E-DB7D8CF74042}.Debug|x86.Build.0 = Debug|Win32
- {25F534DF-93C9-4853-A88E-DB7D8CF74042}.Release|x64.ActiveCfg = Release|Win32
- {25F534DF-93C9-4853-A88E-DB7D8CF74042}.Release|x86.ActiveCfg = Release|Win32
- {25F534DF-93C9-4853-A88E-DB7D8CF74042}.Release|x86.Build.0 = Release|Win32
{63166CEB-02CC-472C-B3B7-E6C559939BDA}.Debug|x64.ActiveCfg = Debug|x64
{63166CEB-02CC-472C-B3B7-E6C559939BDA}.Debug|x64.Build.0 = Debug|x64
{63166CEB-02CC-472C-B3B7-E6C559939BDA}.Debug|x86.ActiveCfg = Debug|Win32
@@ -186,38 +42,6 @@ Global
{63166CEB-02CC-472C-B3B7-E6C559939BDA}.Release|x64.Build.0 = Release|x64
{63166CEB-02CC-472C-B3B7-E6C559939BDA}.Release|x86.ActiveCfg = Release|Win32
{63166CEB-02CC-472C-B3B7-E6C559939BDA}.Release|x86.Build.0 = Release|Win32
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Debug|x64.ActiveCfg = Debug|x64
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Debug|x64.Build.0 = Debug|x64
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Debug|x86.ActiveCfg = Debug|Win32
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Debug|x86.Build.0 = Debug|Win32
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Release|x64.ActiveCfg = Release|x64
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Release|x64.Build.0 = Release|x64
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Release|x86.ActiveCfg = Release|Win32
- {92580BF4-F4DA-4024-B3F8-444F982BC72F}.Release|x86.Build.0 = Release|Win32
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Debug|x64.ActiveCfg = Debug|x64
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Debug|x64.Build.0 = Debug|x64
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Debug|x86.ActiveCfg = Debug|Win32
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Debug|x86.Build.0 = Debug|Win32
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Release|x64.ActiveCfg = Release|x64
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Release|x64.Build.0 = Release|x64
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Release|x86.ActiveCfg = Release|Win32
- {FF92E6C1-BACA-41AD-BB6D-ECA19C05573E}.Release|x86.Build.0 = Release|Win32
- {40A90302-F173-4629-A003-F571D2D93D16}.Debug|x64.ActiveCfg = Debug|x64
- {40A90302-F173-4629-A003-F571D2D93D16}.Debug|x64.Build.0 = Debug|x64
- {40A90302-F173-4629-A003-F571D2D93D16}.Debug|x86.ActiveCfg = Debug|Win32
- {40A90302-F173-4629-A003-F571D2D93D16}.Debug|x86.Build.0 = Debug|Win32
- {40A90302-F173-4629-A003-F571D2D93D16}.Release|x64.ActiveCfg = Release|x64
- {40A90302-F173-4629-A003-F571D2D93D16}.Release|x64.Build.0 = Release|x64
- {40A90302-F173-4629-A003-F571D2D93D16}.Release|x86.ActiveCfg = Release|Win32
- {40A90302-F173-4629-A003-F571D2D93D16}.Release|x86.Build.0 = Release|Win32
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Debug|x64.ActiveCfg = Debug|x64
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Debug|x64.Build.0 = Debug|x64
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Debug|x86.ActiveCfg = Debug|Win32
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Debug|x86.Build.0 = Debug|Win32
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Release|x64.ActiveCfg = Release|x64
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Release|x64.Build.0 = Release|x64
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Release|x86.ActiveCfg = Release|Win32
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}.Release|x86.Build.0 = Release|Win32
{7664D0D2-0263-4BFB-AE19-9A1CAD231440}.Debug|x64.ActiveCfg = Debug|x64
{7664D0D2-0263-4BFB-AE19-9A1CAD231440}.Debug|x64.Build.0 = Debug|x64
{7664D0D2-0263-4BFB-AE19-9A1CAD231440}.Debug|x86.ActiveCfg = Debug|Win32
@@ -226,38 +50,6 @@ Global
{7664D0D2-0263-4BFB-AE19-9A1CAD231440}.Release|x64.Build.0 = Release|x64
{7664D0D2-0263-4BFB-AE19-9A1CAD231440}.Release|x86.ActiveCfg = Release|Win32
{7664D0D2-0263-4BFB-AE19-9A1CAD231440}.Release|x86.Build.0 = Release|Win32
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Debug|x64.ActiveCfg = Debug|x64
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Debug|x64.Build.0 = Debug|x64
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Debug|x86.ActiveCfg = Debug|Win32
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Debug|x86.Build.0 = Debug|Win32
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Release|x64.ActiveCfg = Release|x64
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Release|x64.Build.0 = Release|x64
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Release|x86.ActiveCfg = Release|Win32
- {683745AD-3BC2-4B89-898B-93490D7F2757}.Release|x86.Build.0 = Release|Win32
- {8945255B-473B-4C47-9425-E92384338CAA}.Debug|x64.ActiveCfg = Debug|x64
- {8945255B-473B-4C47-9425-E92384338CAA}.Debug|x64.Build.0 = Debug|x64
- {8945255B-473B-4C47-9425-E92384338CAA}.Debug|x86.ActiveCfg = Debug|Win32
- {8945255B-473B-4C47-9425-E92384338CAA}.Debug|x86.Build.0 = Debug|Win32
- {8945255B-473B-4C47-9425-E92384338CAA}.Release|x64.ActiveCfg = Release|x64
- {8945255B-473B-4C47-9425-E92384338CAA}.Release|x64.Build.0 = Release|x64
- {8945255B-473B-4C47-9425-E92384338CAA}.Release|x86.ActiveCfg = Release|Win32
- {8945255B-473B-4C47-9425-E92384338CAA}.Release|x86.Build.0 = Release|Win32
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Debug|x64.ActiveCfg = Debug|x64
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Debug|x64.Build.0 = Debug|x64
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Debug|x86.ActiveCfg = Debug|Win32
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Debug|x86.Build.0 = Debug|Win32
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Release|x64.ActiveCfg = Release|x64
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Release|x64.Build.0 = Release|x64
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Release|x86.ActiveCfg = Release|Win32
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}.Release|x86.Build.0 = Release|Win32
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Debug|x64.ActiveCfg = Debug|x64
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Debug|x64.Build.0 = Debug|x64
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Debug|x86.ActiveCfg = Debug|Win32
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Debug|x86.Build.0 = Debug|Win32
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Release|x64.ActiveCfg = Release|x64
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Release|x64.Build.0 = Release|x64
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Release|x86.ActiveCfg = Release|Win32
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/icu4c/source/samples/all/samplecheck.bat b/icu4c/source/samples/all/samplecheck.bat
index ab69cb22639..2c45935f026 100644
--- a/icu4c/source/samples/all/samplecheck.bat
+++ b/icu4c/source/samples/all/samplecheck.bat
@@ -42,120 +42,18 @@ echo Testing ICU samples in %ICU_ICUDIR% arch=%ICU_ARCH% type=%ICU_DBRL%
set PATH=%ICU_BINDIR%;%PATH%
pushd %ICU_BINDIR%
-set SAMPLE_BREAK=%ICU_SAMPLESDIR%\break\%ICU_ARCH%\%ICU_DBRL%\break.exe
-set SAMPLE_CAL=%ICU_SAMPLESDIR%\cal\%ICU_ARCH%\%ICU_DBRL%\cal.exe
-set SAMPLE_CASE=%ICU_SAMPLESDIR%\case\%ICU_ARCH%\%ICU_DBRL%\case.exe
-set SAMPLE_CITER=%ICU_SAMPLESDIR%\citer\%ICU_ARCH%\%ICU_DBRL%\citer.exe
set SAMPLE_COLL=%ICU_SAMPLESDIR%\coll\%ICU_ARCH%\%ICU_DBRL%\coll.exe
-set SAMPLE_CSDET=%ICU_SAMPLESDIR%\csdet\%ICU_ARCH%\%ICU_DBRL%\csdet.exe
-set SAMPLE_DATE=%ICU_SAMPLESDIR%\date\%ICU_ARCH%\%ICU_DBRL%\date.exe
-set SAMPLE_DATEFMT=%ICU_SAMPLESDIR%\datefmt\%ICU_ARCH%\%ICU_DBRL%\datefmt.exe
-set SAMPLE_DTITVFMT=%ICU_SAMPLESDIR%\dtitvfmtsample\%ICU_ARCH%\%ICU_DBRL%\dtitvfmtsample.exe
-set SAMPLE_DTPTNG=%ICU_SAMPLESDIR%\dtptngsample\%ICU_ARCH%\%ICU_DBRL%\dtptngsample.exe
-set SAMPLE_MSGFMT=%ICU_SAMPLESDIR%\msgfmt\%ICU_ARCH%\%ICU_DBRL%\msgfmt.exe
-set SAMPLE_NUMFMT=%ICU_SAMPLESDIR%\numfmt\%ICU_ARCH%\%ICU_DBRL%\numfmt.exe
-set SAMPLE_PLURFMTSAMPLE=%ICU_SAMPLESDIR%\plurfmtsample\%ICU_ARCH%\%ICU_DBRL%\plurfmtsample.exe
-set SAMPLE_PROPS=%ICU_SAMPLESDIR%\props\%ICU_ARCH%\%ICU_DBRL%\props.exe
set SAMPLE_STRSRCH=%ICU_SAMPLESDIR%\strsrch\%ICU_ARCH%\%ICU_DBRL%\strsrch.exe
set SAMPLE_TRANSLIT=%ICU_SAMPLESDIR%\translit\%ICU_ARCH%\%ICU_DBRL%\translit.exe
-set SAMPLE_UCITER8=%ICU_SAMPLESDIR%\uciter8\%ICU_ARCH%\%ICU_DBRL%\uciter8.exe
-set SAMPLE_UCNV=%ICU_SAMPLESDIR%\ucnv\%ICU_ARCH%\%ICU_DBRL%\ucnv.exe
-REM udata needs changes to the vcxproj to change the output locations for writer/reader.
-rem set SAMPLE_UDATA_WRITER=%ICU_SAMPLESDIR%\udata\%ICU_ARCH%\%ICU_DBRL%\writer.exe
-rem set SAMPLE_UDATA_READER=%ICU_SAMPLESDIR%\udata\%ICU_ARCH%\%ICU_DBRL%\reader.exe
-set SAMPLE_UFORTUNE=%ICU_SAMPLESDIR%\ufortune\%ICU_ARCH%\%ICU_DBRL%\ufortune.exe
set SAMPLE_UGREP=%ICU_SAMPLESDIR%\ugrep\%ICU_ARCH%\%ICU_DBRL%\ugrep.exe
-REM There is also the 'resources' project in VS.
-set SAMPLE_URESB=%ICU_SAMPLESDIR%\uresb\%ICU_ARCH%\%ICU_DBRL%\uresb.exe
-set SAMPLE_USTRING=%ICU_SAMPLESDIR%\ustring\%ICU_ARCH%\%ICU_DBRL%\ustring.exe
-@set THT=break
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_BREAK%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=cal
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_CAL%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=case
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_CASE%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=citer
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_CITER%
-if ERRORLEVEL 1 goto :SampleError
-
@set THT=coll
@echo.
@echo ==== %THT% =========================================================================
%SAMPLE_COLL%
if ERRORLEVEL 1 goto :SampleError
-@set THT=csdet
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_CSDET% %ICU_SAMPLESDIR%\csdet\readme.txt
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=date
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_DATE%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=datefmt
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_DATEFMT%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=dtitvfmtsample
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_DTITVFMT%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=dtptngsample
-@echo.
-@echo ==== %THT% =========================================================================
-pushd %ICU_SAMPLESDIR%\dtptngsample\%ICU_ARCH%\%ICU_DBRL%
-%SAMPLE_DTPTNG%
-popd
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=msgfmt
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_MSGFMT% arg1 arg2
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=numfmt
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_NUMFMT%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=plurfmtsample
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_PLURFMTSAMPLE%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=props
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_PROPS%
-if ERRORLEVEL 1 goto :SampleError
-
@set THT=strsrch
@echo.
@echo ==== %THT% =========================================================================
@@ -168,43 +66,6 @@ if ERRORLEVEL 1 goto :SampleError
%SAMPLE_TRANSLIT%
if ERRORLEVEL 1 goto :SampleError
-@set THT=citer8
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_UCITER8%
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=ucnv
-@echo.
-@echo ==== %THT% =========================================================================
-pushd %ICU_SAMPLESDIR%\ucnv
-%SAMPLE_UCNV%
-popd
-if ERRORLEVEL 1 goto :SampleError
-
-REM TODO: udata needs changes to the vcxproj file to fix the output locations for writer/reader.
-@set THT=udata
-@echo.
-@echo ==== %THT% =========================================================================
-pushd %ICU_SAMPLESDIR%\udata\%ICU_ARCH%\%ICU_DBRL%
-@echo TODO: udata needs changes to the vcxproj file to fix the output locations for writer/reader.
-@echo Skipping %THT%
-rem %SAMPLE_UDATA_WRITER%
-rem %SAMPLE_UDATA_READER%
-popd
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=ufortune
-@echo.
-@echo ==== %THT% =========================================================================
-if "%ICU_ARCH%" == "x64" (
- @echo The ufortune sample currently only runs on x86.
- @echo Skipping %THT%.
-) else (
- %SAMPLE_UFORTUNE%
- if ERRORLEVEL 1 goto :SampleError
-)
-
@set THT=ugrep
@echo.
@echo ==== %THT% =========================================================================
@@ -212,22 +73,6 @@ echo Looking for "ICU" in '%ICU_SAMPLESDIR%\ugrep\readme.txt' with ugrep.exe
%SAMPLE_UGREP% ICU %ICU_SAMPLESDIR%\ugrep\readme.txt
if ERRORLEVEL 1 goto :SampleError
-@set THT=uresb
-@echo.
-@echo ==== %THT% =========================================================================
-pushd %ICU_SAMPLESDIR%\uresb
-%SAMPLE_URESB% en
-%SAMPLE_URESB% root
-%SAMPLE_URESB% sr
-popd
-if ERRORLEVEL 1 goto :SampleError
-
-@set THT=ustring
-@echo.
-@echo ==== %THT% =========================================================================
-%SAMPLE_USTRING%
-if ERRORLEVEL 1 goto :SampleError
-
rem All done
diff --git a/icu4c/source/samples/break/Makefile b/icu4c/source/samples/break/Makefile
deleted file mode 100644
index 4fda8820bc9..00000000000
--- a/icu4c/source/samples/break/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2002 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=break
-
-# All object files (C or C++)
-OBJECTS=break.o ubreak.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/break/break.cpp b/icu4c/source/samples/break/break.cpp
deleted file mode 100644
index 414a6e0247e..00000000000
--- a/icu4c/source/samples/break/break.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2002-2003, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-
-#include
-#include
-#include
-
-using namespace icu;
-
-U_CFUNC int c_main();
-
-void printUnicodeString(const UnicodeString &s) {
- char charBuf[1000];
- s.extract(0, s.length(), charBuf, sizeof(charBuf) - 1, nullptr);
- charBuf[sizeof(charBuf)-1] = 0;
- printf("%s", charBuf);
-}
-
-
-void printTextRange( BreakIterator& iterator,
- int32_t start, int32_t end )
-{
- CharacterIterator *strIter = iterator.getText().clone();
- UnicodeString s;
- strIter->getText(s);
-
- printf(" %ld %ld\t", (long)start, (long)end);
- printUnicodeString(UnicodeString(s, 0, start));
- printf("|");
- printUnicodeString(UnicodeString(s, start, end-start));
- printf("|");
- printUnicodeString(UnicodeString(s, end));
- puts("");
- delete strIter;
-}
-
-
-/* Print each element in order: */
-void printEachForward( BreakIterator& boundary)
-{
- int32_t start = boundary.first();
- for (int32_t end = boundary.next();
- end != BreakIterator::DONE;
- start = end, end = boundary.next())
- {
- printTextRange( boundary, start, end );
- }
-}
-
-/* Print each element in reverse order: */
-void printEachBackward( BreakIterator& boundary)
-{
- int32_t end = boundary.last();
- for (int32_t start = boundary.previous();
- start != BreakIterator::DONE;
- end = start, start = boundary.previous())
- {
- printTextRange( boundary, start, end );
- }
-}
-
-/* Print the first element */
-void printFirst(BreakIterator& boundary)
-{
- int32_t start = boundary.first();
- int32_t end = boundary.next();
- printTextRange( boundary, start, end );
-}
-
-/* Print the last element */
-void printLast(BreakIterator& boundary)
-{
- int32_t end = boundary.last();
- int32_t start = boundary.previous();
- printTextRange( boundary, start, end );
-}
-
-/* Print the element at a specified position */
-void printAt(BreakIterator &boundary, int32_t pos )
-{
- int32_t end = boundary.following(pos);
- int32_t start = boundary.previous();
- printTextRange( boundary, start, end );
-}
-
-/* Creating and using text boundaries */
-int main()
-{
- puts("ICU Break Iterator Sample Program\n");
- puts("C++ Break Iteration\n");
- BreakIterator* boundary;
- UnicodeString stringToExamine("Aaa bbb ccc. Ddd eee fff.");
- printf("Examining: ");
- printUnicodeString(stringToExamine);
- puts("");
-
- //print each sentence in forward and reverse order
- UErrorCode status = U_ZERO_ERROR;
- boundary = BreakIterator::createSentenceInstance(
- Locale::getUS(), status );
- if (U_FAILURE(status)) {
- printf("failed to create sentence break iterator. status = %s",
- u_errorName(status));
- exit(1);
- }
-
- boundary->setText(stringToExamine);
- puts("\n Sentence Boundaries... ");
- puts("----- forward: -----------");
- printEachForward(*boundary);
- puts("----- backward: ----------");
- printEachBackward(*boundary);
- delete boundary;
-
- //print each word in order
- printf("\n Word Boundaries... \n");
- boundary = BreakIterator::createWordInstance(
- Locale::getUS(), status);
- boundary->setText(stringToExamine);
- puts("----- forward: -----------");
- printEachForward(*boundary);
- //print first element
- puts("----- first: -------------");
- printFirst(*boundary);
- //print last element
- puts("----- last: --------------");
- printLast(*boundary);
- //print word at charpos 10
- puts("----- at pos 10: ---------");
- printAt(*boundary, 10 );
-
- delete boundary;
-
- puts("\nEnd C++ Break Iteration");
-
- // Call the C version
- return c_main();
-}
diff --git a/icu4c/source/samples/break/break.sln b/icu4c/source/samples/break/break.sln
deleted file mode 100644
index 80cca424523..00000000000
--- a/icu4c/source/samples/break/break.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "break", "break.vcxproj", "{DEEADF02-9C14-4854-A395-E505D2904D65}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|Win32.ActiveCfg = Debug|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|Win32.Build.0 = Debug|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|x64.ActiveCfg = Debug|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Debug|x64.Build.0 = Debug|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|Win32.ActiveCfg = Release|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|Win32.Build.0 = Release|Win32
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|x64.ActiveCfg = Release|x64
- {DEEADF02-9C14-4854-A395-E505D2904D65}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/break/break.vcxproj b/icu4c/source/samples/break/break.vcxproj
deleted file mode 100644
index d9a51001d2a..00000000000
--- a/icu4c/source/samples/break/break.vcxproj
+++ /dev/null
@@ -1,153 +0,0 @@
-п»ї
-
-
- {DEEADF02-9C14-4854-A395-E505D2904D65}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- Level3
-
-
-
-
- .\x86\Release/break.tlb
-
-
- OnlyExplicitInline
- MultiThreaded
- true
-
-
- .\x86\Release/break.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x86\Release/break.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Release/break.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/break.tlb
-
-
- OnlyExplicitInline
- MultiThreaded
- true
-
-
- .\x64\Release/break.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x64\Release/break.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/break.pdb
- Console
-
-
-
-
-
-
- .\x86\Debug/break.tlb
-
-
- EnableFastChecks
- MultiThreadedDebug
-
-
- .\x86\Debug/break.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- EditAndContinue
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x86\Debug/break.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/break.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/break.tlb
-
-
- EnableFastChecks
- MultiThreadedDebug
-
-
- .\x64\Debug/break.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- ProgramDatabase
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x64\Debug/break.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/break.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/break/break.vcxproj.filters b/icu4c/source/samples/break/break.vcxproj.filters
deleted file mode 100644
index 016ad4ab9a0..00000000000
--- a/icu4c/source/samples/break/break.vcxproj.filters
+++ /dev/null
@@ -1,25 +0,0 @@
-п»ї
-
-
-
- {3cfd1084-1652-4648-bb97-9b38a2780005}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {34cb1edc-aa5a-4702-b867-a867ebe8496c}
- h;hpp;hxx;hm;inl
-
-
- {6aea4120-7995-4705-b3b7-7013af485c18}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/break/readme.txt b/icu4c/source/samples/break/readme.txt
deleted file mode 100644
index debedd1e7ca..00000000000
--- a/icu4c/source/samples/break/readme.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002-2010, International Business Machines Corporation and others. All Rights Reserved.
-break: Boundary Analysis
-
-This sample demonstrates
- Using ICU to determine the linguistic boundaries within text
-
-
-Files:
- break.cpp Main source file in C++
- ubreak.c Main source file in C
- break.sln Windows MSVC workspace. Double-click this to get started.
- break.vcproj Windows MSVC project file
-
-To Build break on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\break\break.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the break directory, e.g.
- cd c:\icu\source\samples\break\debug
- 4. Run it (Warning: Be careful, 'break' is also a system command on many systems)
- .\break
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/break
- gmake ICU_PREFIX=/source/samples/break
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- break
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/break/ubreak.c b/icu4c/source/samples/break/ubreak.c
deleted file mode 100644
index 10d7d0b4902..00000000000
--- a/icu4c/source/samples/break/ubreak.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2002, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-
-#include
-#include
-#include
-#include
-
-U_CFUNC int c_main(void);
-
-void printTextRange(UChar* str, int32_t start, int32_t end)
-{
- char charBuf[1000];
- UChar savedEndChar;
-
- savedEndChar = str[end];
- str[end] = 0;
- u_austrncpy(charBuf, str+start, sizeof(charBuf)-1);
- charBuf[sizeof(charBuf)-1]=0;
- printf("string[%2d..%2d] \"%s\"\n", start, end-1, charBuf);
- str[end] = savedEndChar;
-}
-
-
-
-/* Print each element in order: */
-void printEachForward( UBreakIterator* boundary, UChar* str) {
- int32_t end;
- int32_t start = ubrk_first(boundary);
- for (end = ubrk_next(boundary); end != UBRK_DONE; start = end, end =
- ubrk_next(boundary)) {
- printTextRange(str, start, end );
- }
-}
-
-
-/* Print each element in reverse order: */
-void printEachBackward( UBreakIterator* boundary, UChar* str) {
- int32_t start;
- int32_t end = ubrk_last(boundary);
- for (start = ubrk_previous(boundary); start != UBRK_DONE; end = start,
- start =ubrk_previous(boundary)) {
- printTextRange( str, start, end );
- }
-}
-
-/* Print first element */
-void printFirst(UBreakIterator* boundary, UChar* str) {
- int32_t end;
- int32_t start = ubrk_first(boundary);
- end = ubrk_next(boundary);
- printTextRange( str, start, end );
-}
-
-/* Print last element */
-void printLast(UBreakIterator* boundary, UChar* str) {
- int32_t start;
- int32_t end = ubrk_last(boundary);
- start = ubrk_previous(boundary);
- printTextRange(str, start, end );
-}
-
-/* Print the element at a specified position */
-
-void printAt(UBreakIterator* boundary, int32_t pos , UChar* str) {
- int32_t start;
- int32_t end = ubrk_following(boundary, pos);
- start = ubrk_previous(boundary);
- printTextRange(str, start, end );
-}
-
-/* Creating and using text boundaries*/
-
-int c_main( void ) {
- UBreakIterator *boundary;
- char cStringToExamine[] = "Aaa bbb ccc. Ddd eee fff.";
- UChar stringToExamine[sizeof(cStringToExamine)+1];
- UErrorCode status = U_ZERO_ERROR;
-
- printf("\n\n"
- "C Boundary Analysis\n"
- "-------------------\n\n");
-
- printf("Examining: %s\n", cStringToExamine);
- u_uastrcpy(stringToExamine, cStringToExamine);
-
- /*print each sentence in forward and reverse order*/
- boundary = ubrk_open(UBRK_SENTENCE, "en_us", stringToExamine,
- -1, &status);
- if (U_FAILURE(status)) {
- printf("ubrk_open error: %s\n", u_errorName(status));
- exit(1);
- }
-
- printf("\n----- Sentence Boundaries, forward: -----------\n");
- printEachForward(boundary, stringToExamine);
- printf("\n----- Sentence Boundaries, backward: ----------\n");
- printEachBackward(boundary, stringToExamine);
- ubrk_close(boundary);
-
- /*print each word in order*/
- boundary = ubrk_open(UBRK_WORD, "en_us", stringToExamine,
- u_strlen(stringToExamine), &status);
- printf("\n----- Word Boundaries, forward: -----------\n");
- printEachForward(boundary, stringToExamine);
- printf("\n----- Word Boundaries, backward: ----------\n");
- printEachBackward(boundary, stringToExamine);
- /*print first element*/
- printf("\n----- first: -------------\n");
- printFirst(boundary, stringToExamine);
- /*print last element*/
- printf("\n----- last: --------------\n");
- printLast(boundary, stringToExamine);
- /*print word at charpos 10 */
- printf("\n----- at pos 10: ---------\n");
- printAt(boundary, 10 , stringToExamine);
-
- ubrk_close(boundary);
-
- printf("\nEnd of C boundary analysis\n");
- return 0;
-}
diff --git a/icu4c/source/samples/cal/Makefile.in b/icu4c/source/samples/cal/Makefile.in
deleted file mode 100644
index f696350693e..00000000000
--- a/icu4c/source/samples/cal/Makefile.in
+++ /dev/null
@@ -1,78 +0,0 @@
-## Copyright (C) 2016 and later: Unicode, Inc. and others.
-## License & terms of use: http://www.unicode.org/copyright.html
-##
-## Makefile.in for ICU - samples/cal
-## Copyright (c) 1999-2011, International Business Machines Corporation and
-## others. All Rights Reserved.
-
-## Source directory information
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-## Install directory information
-top_builddir = ../..
-
-include $(top_builddir)/icudefs.mk
-
-## Build directory information
-subdir = samples/cal
-
-## Extra files to remove for 'make clean'
-CLEANFILES = *~ $(DEPS)
-
-## Target information
-TARGET = icucal$(EXEEXT)
-
-CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
-LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
-
-OBJECTS = uprint.o cal.o
-
-DEPS = $(OBJECTS:.o=.d)
-
-## List of phony targets
-.PHONY : all all-local install install-local clean clean-local \
-distclean distclean-local dist dist-local check check-local
-
-## Clear suffix list
-.SUFFIXES :
-
-## List of standard targets
-all: all-local
-install: install-local
-clean: clean-local
-distclean : distclean-local
-dist: dist-local
-check: all check-local
-
-all-local: $(TARGET)
-
-install-local: all-local
-
-dist-local:
-
-clean-local:
- test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
- $(RMV) $(OBJECTS) $(TARGET)
-
-distclean-local: clean-local
- $(RMV) Makefile
-
-check-local:
- -$(INVOKE) ./$(TARGET)
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(TARGET) : $(OBJECTS)
- $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
- $(POST_BUILD_STEP)
-
-ifeq (,$(MAKECMDGOALS))
--include $(DEPS)
-else
-ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
--include $(DEPS)
-endif
-endif
diff --git a/icu4c/source/samples/cal/cal.c b/icu4c/source/samples/cal/cal.c
deleted file mode 100644
index 2725d44aa80..00000000000
--- a/icu4c/source/samples/cal/cal.c
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
-***********************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-***********************************************************************
-**********************************************************************
-* Copyright (C) 1998-2012, International Business Machines Corporation
-* and others. All Rights Reserved.
-**********************************************************************
-*
-* File date.c
-*
-* Modification History:
-*
-* Date Name Description
-* 06/16/99 stephen Creation.
-*******************************************************************************
-*/
-
-#include
-#include
-#include
-
-#include "unicode/uloc.h"
-#include "unicode/udat.h"
-#include "unicode/ucal.h"
-#include "unicode/ustring.h"
-#include "unicode/uclean.h"
-
-#include "uprint.h"
-
-#if UCONFIG_NO_FORMATTING
-
-int main(int argc, char **argv)
-{
- printf("%s: Sorry, UCONFIG_NO_FORMATTING was turned on (see uconfig.h). No formatting can be done. \n", argv[0]);
- return 0;
-}
-#else
-
-
-/* Protos */
-static void usage(void);
-
-static void version(void);
-
-static void cal(int32_t month, int32_t year,
- UBool useLongNames, UErrorCode *status);
-
-static void get_symbols(const UDateFormat *fmt,
- UDateFormatSymbolType type,
- UChar *array[],
- int32_t arrayLength,
- int32_t lowestIndex,
- int32_t firstIndex,
- UErrorCode *status);
-
-static void free_symbols(UChar *array[],
- int32_t arrayLength);
-
-static void get_days(const UDateFormat *fmt,
- UChar *days [], UBool useLongNames,
- int32_t fdow, UErrorCode *status);
-
-static void free_days(UChar *days[]);
-
-static void get_months(const UDateFormat *fmt,
- UChar *months [], UBool useLongNames,
- UErrorCode *status);
-
-static void free_months(UChar *months[]);
-
-static void indent(int32_t count, FILE *f);
-
-static void print_days(UChar *days [], FILE *f, UErrorCode *status);
-
-static void print_month(UCalendar *c,
- UChar *days [],
- UBool useLongNames, int32_t fdow,
- UErrorCode *status);
-
-static void print_year(UCalendar *c,
- UChar *days [], UChar *months [],
- UBool useLongNames, int32_t fdow,
- UErrorCode *status);
-
-/* The version of cal */
-#define CAL_VERSION "1.0"
-
-/* Number of days in a week */
-#define DAY_COUNT 7
-
-/* Number of months in a year (yes, 13) */
-#define MONTH_COUNT 13
-
-/* Separation between months in year view */
-#define MARGIN_WIDTH 4
-
-/* Size of stack buffers */
-#define BUF_SIZE 64
-
-/* Patterm string - "MMM yyyy" */
-static const UChar sShortPat [] = { 0x004D, 0x004D, 0x004D, 0x0020,
-0x0079, 0x0079, 0x0079, 0x0079 };
-/* Pattern string - "MMMM yyyy" */
-static const UChar sLongPat [] = { 0x004D, 0x004D, 0x004D, 0x004D, 0x0020,
-0x0079, 0x0079, 0x0079, 0x0079 };
-
-
-int
-main(int argc,
- char **argv)
-{
- int printUsage = 0;
- int printVersion = 0;
- UBool useLongNames = 0;
- int optInd = 1;
- char *arg;
- int32_t month = -1, year = -1;
- UErrorCode status = U_ZERO_ERROR;
-
-
- /* parse the options */
- for(optInd = 1; optInd < argc; ++optInd) {
- arg = argv[optInd];
-
- /* version info */
- if(strcmp(arg, "-v") == 0 || strcmp(arg, "--version") == 0) {
- printVersion = 1;
- }
- /* usage info */
- else if(strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) {
- printUsage = 1;
- }
- /* use long day names */
- else if(strcmp(arg, "-l") == 0 || strcmp(arg, "--long") == 0) {
- useLongNames = 1;
- }
- /* POSIX.1 says all arguments after -- are not options */
- else if(strcmp(arg, "--") == 0) {
- /* skip the -- */
- ++optInd;
- break;
- }
- /* unrecognized option */
- else if(strncmp(arg, "-", strlen("-")) == 0) {
- printf("cal: invalid option -- %s\n", arg+1);
- printUsage = 1;
- }
- /* done with options, display cal */
- else {
- break;
- }
- }
-
- /* Get the month and year to display, if specified */
- if(optInd != argc) {
-
- /* Month and year specified */
- if(argc - optInd == 2) {
- sscanf(argv[optInd], "%d", (int*)&month);
- sscanf(argv[optInd + 1], "%d", (int*)&year);
-
- /* Make sure the month value is legal */
- if(month < 0 || month > 12) {
- printf("icucal: Bad value for month -- %d\n", (int)month);
-
- /* Display usage */
- printUsage = 1;
- }
-
- /* Adjust because months are 0-based */
- --month;
- }
- /* Only year specified */
- else {
- sscanf(argv[optInd], "%d", (int*)&year);
- }
- }
-
- /* print usage info */
- if(printUsage) {
- usage();
- return 0;
- }
-
- /* print version info */
- if(printVersion) {
- version();
- return 0;
- }
-
- /* print the cal */
- cal(month, year, useLongNames, &status);
-
- /* ICU cleanup. Deallocate any memory ICU may be holding. */
- u_cleanup();
-
- return (U_FAILURE(status) ? 1 : 0);
-}
-
-/* Usage information */
-static void
-usage(void)
-{
- puts("Usage: icucal [OPTIONS] [[MONTH] YEAR]");
- puts("");
- puts("Options:");
- puts(" -h, --help Print this message and exit.");
- puts(" -v, --version Print the version number of cal and exit.");
- puts(" -l, --long Use long names.");
- puts("");
- puts("Arguments (optional):");
- puts(" MONTH An integer (1-12) indicating the month to display");
- puts(" YEAR An integer indicating the year to display");
- puts("");
- puts("For an interesting calendar, look at October 1582");
-}
-
-/* Version information */
-static void
-version(void)
-{
- printf("icucal version %s (ICU version %s), created by Stephen F. Booth.\n",
- CAL_VERSION, U_ICU_VERSION);
- puts(U_COPYRIGHT_STRING);
-}
-
-static void
-cal(int32_t month,
- int32_t year,
- UBool useLongNames,
- UErrorCode *status)
-{
- UCalendar *c;
- UChar *days [DAY_COUNT];
- UChar *months [MONTH_COUNT];
- int32_t fdow;
-
- if(U_FAILURE(*status)) return;
-
- /* Create a new calendar */
- c = ucal_open(0, -1, uloc_getDefault(), UCAL_TRADITIONAL, status);
-
- /* Determine if we are printing a calendar for one month or for a year */
-
- /* Print an entire year */
- if(month == -1 && year != -1) {
-
- /* Set the year */
- ucal_set(c, UCAL_YEAR, year);
-
- /* Determine the first day of the week */
- fdow = ucal_getAttribute(c, UCAL_FIRST_DAY_OF_WEEK);
-
- /* Print the calendar for the year */
- print_year(c, days, months, useLongNames, fdow, status);
- }
-
- /* Print only one month */
- else {
-
- /* Set the month and the year, if specified */
- if(month != -1)
- ucal_set(c, UCAL_MONTH, month);
- if(year != -1)
- ucal_set(c, UCAL_YEAR, year);
-
- /* Determine the first day of the week */
- fdow = ucal_getAttribute(c, UCAL_FIRST_DAY_OF_WEEK);
-
- /* Print the calendar for the month */
- print_month(c, days, useLongNames, fdow, status);
- }
-
- /* Clean up */
- ucal_close(c);
-}
-/*
- * Get a set of DateFormat symbols of a given type.
- *
- * lowestIndex is the index of the first symbol to fetch.
- * (e.g. it will be one to fetch day names, since Sunday is
- * day 1 *not* day 0.)
- *
- * firstIndex is the index of the symbol to place first in
- * the output array. This is used when fetching day names
- * in locales where the week doesn't start on Sunday.
- */
-static void get_symbols(const UDateFormat *fmt,
- UDateFormatSymbolType type,
- UChar *array[],
- int32_t arrayLength,
- int32_t lowestIndex,
- int32_t firstIndex,
- UErrorCode *status)
-{
- int32_t count, i;
-
- if (U_FAILURE(*status)) {
- return;
- }
-
- count = udat_countSymbols(fmt, type);
-
- if(count != arrayLength + lowestIndex) {
- return;
- }
-
- for(i = 0; i < arrayLength; i++) {
- int32_t idx = (i + firstIndex) % arrayLength;
- int32_t size = 1 + udat_getSymbols(fmt, type, idx + lowestIndex, NULL, 0, status);
-
- array[idx] = (UChar *) malloc(sizeof(UChar) * size);
-
- *status = U_ZERO_ERROR;
- udat_getSymbols(fmt, type, idx + lowestIndex, array[idx], size, status);
- }
-}
-
-/* Free the symbols allocated by get_symbols(). */
-static void free_symbols(UChar *array[],
- int32_t arrayLength)
-{
- int32_t i;
-
- for(i = 0; i < arrayLength; i++) {
- free(array[i]);
- }
-}
-
-/* Get the day names for the specified locale, in either long or short
-form. Also, reorder the days so that they are in the proper order
-for the locale (not all locales begin weeks on Sunday; in France,
-weeks start on Monday) */
-static void
-get_days(const UDateFormat *fmt,
- UChar *days [],
- UBool useLongNames,
- int32_t fdow,
- UErrorCode *status)
-{
- UDateFormatSymbolType dayType = (useLongNames ? UDAT_WEEKDAYS : UDAT_SHORT_WEEKDAYS);
-
- if(U_FAILURE(*status))
- return;
-
- /* fdow is 1-based */
- --fdow;
-
- get_symbols(fmt, dayType, days, DAY_COUNT, 1, fdow, status);
-}
-
-static void free_days(UChar *days[])
-{
- free_symbols(days, DAY_COUNT);
-}
-
-/* Get the month names for the specified locale, in either long or
-short form. */
-static void
-get_months(const UDateFormat *fmt,
- UChar *months [],
- UBool useLongNames,
- UErrorCode *status)
-{
- UDateFormatSymbolType monthType = (useLongNames ? UDAT_MONTHS : UDAT_SHORT_MONTHS);
-
- if(U_FAILURE(*status))
- return;
-
- get_symbols(fmt, monthType, months, MONTH_COUNT - 1, 0, 0, status); /* some locales have 13 months, no idea why */
-}
-
-static void free_months(UChar *months[])
-{
- free_symbols(months, MONTH_COUNT - 1);
-}
-
-/* Indent a certain number of spaces */
-static void
-indent(int32_t count,
- FILE *f)
-{
- char c [BUF_SIZE];
-
- if(count <= 0)
- {
- return;
- }
-
- if(count < BUF_SIZE) {
- memset(c, (int)' ', count);
- fwrite(c, sizeof(char), count, f);
- }
- else {
- int32_t i;
- for(i = 0; i < count; ++i)
- putc(' ', f);
- }
-}
-
-/* Print the days */
-static void
-print_days(UChar *days [],
- FILE *f,
- UErrorCode *status)
-{
- int32_t i;
-
- if(U_FAILURE(*status)) return;
-
- /* Print the day names */
- for(i = 0; i < DAY_COUNT; ++i) {
- uprint(days[i], f, status);
- putc(' ', f);
- }
-}
-
-/* Print out a calendar for c's current month */
-static void
-print_month(UCalendar *c,
- UChar *days [],
- UBool useLongNames,
- int32_t fdow,
- UErrorCode *status)
-{
- int32_t width, pad, i, day;
- int32_t lens [DAY_COUNT];
- int32_t firstday, current;
- UNumberFormat *nfmt;
- UDateFormat *dfmt;
- UChar s [BUF_SIZE];
- const UChar *pat = (useLongNames ? sLongPat : sShortPat);
- int32_t len = (useLongNames ? 9 : 8);
-
- if(U_FAILURE(*status)) return;
-
-
- /* ========== Generate the header containing the month and year */
-
- /* Open a formatter with a month and year only pattern */
- dfmt = udat_open(UDAT_PATTERN,UDAT_PATTERN,NULL,NULL,0,pat, len,status);
-
- /* Format the date */
- udat_format(dfmt, ucal_getMillis(c, status), s, BUF_SIZE, 0, status);
-
-
- /* ========== Get the day names */
- get_days(dfmt, days, useLongNames, fdow, status);
-
- /* ========== Print the header */
-
- /* Calculate widths for justification */
- width = 6; /* 6 spaces, 1 between each day name */
- for(i = 0; i < DAY_COUNT; ++i) {
- lens[i] = u_strlen(days[i]);
- width += lens[i];
- }
-
- /* Print the header, centered among the day names */
- pad = width - u_strlen(s);
- indent(pad / 2, stdout);
- uprint(s, stdout, status);
- putc('\n', stdout);
-
-
- /* ========== Print the day names */
-
- print_days(days, stdout, status);
- putc('\n', stdout);
-
-
- /* ========== Print the calendar */
-
- /* Get the first of the month */
- ucal_set(c, UCAL_DATE, 1);
- firstday = ucal_get(c, UCAL_DAY_OF_WEEK, status);
-
- /* The day of the week for the first day of the month is based on
- 1-based days of the week, which were also reordered when placed
- in the days array. Account for this here by offsetting by the
- first day of the week for the locale, which is also 1-based. */
- firstday -= fdow;
-
- /* Open the formatter */
- nfmt = unum_open(UNUM_DECIMAL, NULL,0,NULL,NULL, status);
-
- /* Indent the correct number of spaces for the first week */
- current = firstday;
- if(current < 0)
- {
- current += 7;
- }
- for(i = 0; i < current; ++i)
- indent(lens[i] + 1, stdout);
-
- /* Finally, print out the days */
- day = ucal_get(c, UCAL_DATE, status);
- do {
-
- /* Format the current day string */
- unum_format(nfmt, day, s, BUF_SIZE, 0, status);
-
- /* Calculate the justification and indent */
- pad = lens[current] - u_strlen(s);
- indent(pad, stdout);
-
- /* Print the day number out, followed by a space */
- uprint(s, stdout, status);
- putc(' ', stdout);
-
- /* Update the current day */
- ++current;
- current %= DAY_COUNT;
-
- /* If we're at day 0 (first day of the week), insert a newline */
- if(current == 0) {
- putc('\n', stdout);
- }
-
- /* Go to the next day */
- ucal_add(c, UCAL_DATE, 1, status);
- day = ucal_get(c, UCAL_DATE, status);
-
- } while(day != 1);
-
- /* Output a trailing newline */
- putc('\n', stdout);
-
- /* Clean up */
- free_days(days);
- unum_close(nfmt);
- udat_close(dfmt);
-}
-
-/* Print out a calendar for c's current year */
-static void
-print_year(UCalendar *c,
- UChar *days [],
- UChar *months [],
- UBool useLongNames,
- int32_t fdow,
- UErrorCode *status)
-{
- int32_t width, pad, i, j;
- int32_t lens [DAY_COUNT];
- UNumberFormat *nfmt;
- UDateFormat *dfmt;
- UChar s [BUF_SIZE];
- const UChar pat [] = { 0x0079, 0x0079, 0x0079, 0x0079 };
- int32_t len = 4;
- UCalendar *left_cal, *right_cal;
- int32_t left_day, right_day;
- int32_t left_firstday, right_firstday, left_current, right_current;
- int32_t left_month, right_month;
-
- if(U_FAILURE(*status)) return;
-
- /* Alias */
- left_cal = c;
-
- /* ========== Generate the header containing the year (only) */
-
- /* Open a formatter with a month and year only pattern */
- dfmt = udat_open(UDAT_PATTERN,UDAT_PATTERN,NULL,NULL,0,pat, len, status);
-
- /* Format the date */
- udat_format(dfmt, ucal_getMillis(left_cal, status), s, BUF_SIZE, 0, status);
-
- /* ========== Get the month and day names */
- get_days(dfmt, days, useLongNames, fdow, status);
- get_months(dfmt, months, useLongNames, status);
-
- /* ========== Print the header, centered */
-
- /* Calculate widths for justification */
- width = 6; /* 6 spaces, 1 between each day name */
- for(i = 0; i < DAY_COUNT; ++i) {
- lens[i] = u_strlen(days[i]);
- width += lens[i];
- }
-
- /* width is the width for 1 calendar; we are displaying in 2 cols
- with MARGIN_WIDTH spaces between months */
-
- /* Print the header, centered among the day names */
- pad = 2 * width + MARGIN_WIDTH - u_strlen(s);
- indent(pad / 2, stdout);
- uprint(s, stdout, status);
- putc('\n', stdout);
- putc('\n', stdout);
-
- /* Generate a copy of the calendar to use */
- right_cal = ucal_open(0, -1, uloc_getDefault(), UCAL_TRADITIONAL, status);
- ucal_setMillis(right_cal, ucal_getMillis(left_cal, status), status);
-
- /* Open the formatter */
- nfmt = unum_open(UNUM_DECIMAL,NULL, 0,NULL,NULL, status);
-
- /* ========== Calculate and display the months, two at a time */
- for(i = 0; i < MONTH_COUNT - 1; i += 2) {
-
- /* Print the month names for the two current months */
- pad = width - u_strlen(months[i]);
- indent(pad / 2, stdout);
- uprint(months[i], stdout, status);
- indent(pad / 2 + MARGIN_WIDTH, stdout);
- pad = width - u_strlen(months[i + 1]);
- indent(pad / 2, stdout);
- uprint(months[i + 1], stdout, status);
- putc('\n', stdout);
-
- /* Print the day names, twice */
- print_days(days, stdout, status);
- indent(MARGIN_WIDTH, stdout);
- print_days(days, stdout, status);
- putc('\n', stdout);
-
- /* Setup the two calendars */
- ucal_set(left_cal, UCAL_MONTH, i);
- ucal_set(left_cal, UCAL_DATE, 1);
- ucal_set(right_cal, UCAL_MONTH, i + 1);
- ucal_set(right_cal, UCAL_DATE, 1);
-
- left_firstday = ucal_get(left_cal, UCAL_DAY_OF_WEEK, status);
- right_firstday = ucal_get(right_cal, UCAL_DAY_OF_WEEK, status);
-
- /* The day of the week for the first day of the month is based on
- 1-based days of the week. However, the days were reordered
- when placed in the days array. Account for this here by
- offsetting by the first day of the week for the locale, which
- is also 1-based. */
-
- /* We need to mod by DAY_COUNT since fdow can be > firstday. IE,
- if fdow = 2 = Monday (like in France) and the first day of the
- month is a 1 = Sunday, we want firstday to be 6, not -1 */
- left_firstday += (DAY_COUNT - fdow);
- left_firstday %= DAY_COUNT;
-
- right_firstday += (DAY_COUNT - fdow);
- right_firstday %= DAY_COUNT;
-
- left_current = left_firstday;
- right_current = right_firstday;
-
- left_day = ucal_get(left_cal, UCAL_DATE, status);
- right_day = ucal_get(right_cal, UCAL_DATE, status);
-
- left_month = ucal_get(left_cal, UCAL_MONTH, status);
- right_month = ucal_get(right_cal, UCAL_MONTH, status);
-
- /* Finally, print out the days */
- while(left_month == i || right_month == i + 1) {
-
- /* If the left month is finished printing, but the right month
- still has days to be printed, indent the width of the days
- strings and reset the left calendar's current day to 0 */
- if(left_month != i && right_month == i + 1) {
- indent(width + 1, stdout);
- left_current = 0;
- }
-
- while(left_month == i) {
-
- /* If the day is the first, indent the correct number of
- spaces for the first week */
- if(left_day == 1) {
- for(j = 0; j < left_current; ++j)
- indent(lens[j] + 1, stdout);
- }
-
- /* Format the current day string */
- unum_format(nfmt, left_day, s, BUF_SIZE, 0, status);
-
- /* Calculate the justification and indent */
- pad = lens[left_current] - u_strlen(s);
- indent(pad, stdout);
-
- /* Print the day number out, followed by a space */
- uprint(s, stdout, status);
- putc(' ', stdout);
-
- /* Update the current day */
- ++left_current;
- left_current %= DAY_COUNT;
-
- /* Go to the next day */
- ucal_add(left_cal, UCAL_DATE, 1, status);
- left_day = ucal_get(left_cal, UCAL_DATE, status);
-
- /* Determine the month */
- left_month = ucal_get(left_cal, UCAL_MONTH, status);
-
- /* If we're at day 0 (first day of the week), break and go to
- the next month */
- if(left_current == 0) {
- break;
- }
- }
-
- /* If the current day isn't 0, indent to make up for missing
- days at the end of the month */
- if(left_current != 0) {
- for(j = left_current; j < DAY_COUNT; ++j)
- indent(lens[j] + 1, stdout);
- }
-
- /* Indent between the two months */
- indent(MARGIN_WIDTH, stdout);
-
- while(right_month == i + 1) {
-
- /* If the day is the first, indent the correct number of
- spaces for the first week */
- if(right_day == 1) {
- for(j = 0; j < right_current; ++j)
- indent(lens[j] + 1, stdout);
- }
-
- /* Format the current day string */
- unum_format(nfmt, right_day, s, BUF_SIZE, 0, status);
-
- /* Calculate the justification and indent */
- pad = lens[right_current] - u_strlen(s);
- indent(pad, stdout);
-
- /* Print the day number out, followed by a space */
- uprint(s, stdout, status);
- putc(' ', stdout);
-
- /* Update the current day */
- ++right_current;
- right_current %= DAY_COUNT;
-
- /* Go to the next day */
- ucal_add(right_cal, UCAL_DATE, 1, status);
- right_day = ucal_get(right_cal, UCAL_DATE, status);
-
- /* Determine the month */
- right_month = ucal_get(right_cal, UCAL_MONTH, status);
-
- /* If we're at day 0 (first day of the week), break out */
- if(right_current == 0) {
- break;
- }
-
- }
-
- /* Output a newline */
- putc('\n', stdout);
- }
-
- /* Output a trailing newline */
- putc('\n', stdout);
- }
-
- /* Clean up */
- free_months(months);
- free_days(days);
- udat_close(dfmt);
- unum_close(nfmt);
- ucal_close(right_cal);
-}
-
-#endif
diff --git a/icu4c/source/samples/cal/cal.sln b/icu4c/source/samples/cal/cal.sln
deleted file mode 100644
index 19f41e9f039..00000000000
--- a/icu4c/source/samples/cal/cal.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cal", "cal.vcxproj", "{F7659D77-09CF-4FE9-ACEE-927287AA9509}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|Win32.ActiveCfg = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|Win32.Build.0 = Debug|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.ActiveCfg = Debug|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Debug|x64.Build.0 = Debug|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|Win32.ActiveCfg = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|Win32.Build.0 = Release|Win32
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.ActiveCfg = Release|x64
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/cal/cal.vcxproj b/icu4c/source/samples/cal/cal.vcxproj
deleted file mode 100644
index 2051033546d..00000000000
--- a/icu4c/source/samples/cal/cal.vcxproj
+++ /dev/null
@@ -1,157 +0,0 @@
-п»ї
-
-
- Application
- false
- MultiByte
-
-
- {F7659D77-09CF-4FE9-ACEE-927287AA9509}
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- Level3
-
-
-
-
- .\x86\Release/cal.tlb
-
-
- OnlyExplicitInline
- MultiThreadedDLL
- true
-
-
- .\x86\Release/cal.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x86\Release/cal.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- .\x86\Release/cal.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/cal.tlb
-
-
- OnlyExplicitInline
- MultiThreadedDLL
- true
-
-
- .\x64\Release/cal.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x64\Release/cal.exe
- ../../../lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/cal.pdb
- Console
-
-
-
-
-
-
- .\x86\Debug/cal.tlb
-
-
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- .\x86\Debug/cal.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- true
- EditAndContinue
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x86\Debug/cal.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/cal.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/cal.tlb
-
-
- MultiThreadedDebugDLL
-
-
- .\x64\Debug/cal.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- true
- ProgramDatabase
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x64\Debug/cal.exe
- ../../../lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/cal.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/cal/cal.vcxproj.filters b/icu4c/source/samples/cal/cal.vcxproj.filters
deleted file mode 100644
index 1d14d63b2ca..00000000000
--- a/icu4c/source/samples/cal/cal.vcxproj.filters
+++ /dev/null
@@ -1,30 +0,0 @@
-п»ї
-
-
-
- {3e036a59-b898-49e5-9d06-4878387b4a02}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {ace55cd2-56c0-4c6d-965b-8866c5396b04}
- h;hpp;hxx;hm;inl
-
-
- {823558d3-c303-4670-9e92-d8f5c02e39e2}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Header Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/cal/readme.txt b/icu4c/source/samples/cal/readme.txt
deleted file mode 100644
index c9a73aa71bc..00000000000
--- a/icu4c/source/samples/cal/readme.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved.
-icucal: a sample program which displays the calendar.
-
-This sample demonstrates
- Formatting a calendar
- Outputting text in the default codepage to the console
-
-
-Files:
- cal.c Main source file
- uprint.h codepage output convenience header
- uprint.h codepage output convenience implementation
- cal.sln Windows MSVC workspace. Double-click this to get started.
- cal.vcproj Windows MSVC project file
-
-To Build icucal on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\cal\cal.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the cal directory, e.g.
- cd c:\icu\source\samples\cal\debug
- 4. Run it
- cal
-
-To Build on Unixes
- 1. Build ICU. icucal is built automatically by default unless samples are turned off.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- To Run on Unixes
- cd /source/samples/cal
-
- gmake check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- cal
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/cal/uprint.c b/icu4c/source/samples/cal/uprint.c
deleted file mode 100644
index 59c5d3b830c..00000000000
--- a/icu4c/source/samples/cal/uprint.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-***********************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-***********************************************************************
-**********************************************************************
-* Copyright (C) 1998-2001, International Business Machines Corporation
-* and others. All Rights Reserved.
-**********************************************************************
-*
-* File date.c
-*
-* Modification History:
-*
-* Date Name Description
-* 06/14/99 stephen Creation.
-*******************************************************************************
-*/
-
-#include "uprint.h"
-#include
-#include "unicode/ucnv.h"
-#include "unicode/ustring.h"
-
-#define BUF_SIZE 128
-
-/* Print a ustring to the specified FILE* in the default codepage */
-void
-uprint(const UChar *s,
- FILE *f,
- UErrorCode *status)
-{
- /* converter */
- UConverter *converter;
- char buf [BUF_SIZE];
- int32_t sourceLen;
- const UChar *mySource;
- const UChar *mySourceEnd;
- char *myTarget;
- int32_t arraySize;
-
- if(s == 0) return;
-
- /* set up the conversion parameters */
- sourceLen = u_strlen(s);
- mySource = s;
- mySourceEnd = mySource + sourceLen;
- myTarget = buf;
- arraySize = BUF_SIZE;
-
- /* open a default converter */
- converter = ucnv_open(0, status);
-
- /* if we failed, clean up and exit */
- if(U_FAILURE(*status)) goto finish;
-
- /* perform the conversion */
- do {
- /* reset the error code */
- *status = U_ZERO_ERROR;
-
- /* perform the conversion */
- ucnv_fromUnicode(converter, &myTarget, myTarget + arraySize,
- &mySource, mySourceEnd, NULL,
- true, status);
-
- /* Write the converted data to the FILE* */
- fwrite(buf, sizeof(char), myTarget - buf, f);
-
- /* update the conversion parameters*/
- myTarget = buf;
- arraySize = BUF_SIZE;
- }
- while(*status == U_BUFFER_OVERFLOW_ERROR);
-
- finish:
-
- /* close the converter */
- ucnv_close(converter);
-}
diff --git a/icu4c/source/samples/cal/uprint.h b/icu4c/source/samples/cal/uprint.h
deleted file mode 100644
index 49db38b724a..00000000000
--- a/icu4c/source/samples/cal/uprint.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-***********************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-***********************************************************************
-**********************************************************************
-* Copyright (C) 1998-2004, International Business Machines Corporation
-* and others. All Rights Reserved.
-**********************************************************************
-*
-* File uprint.h
-*
-* Modification History:
-*
-* Date Name Description
-* 06/14/99 stephen Creation.
-*******************************************************************************
-*/
-
-#ifndef UPRINT_H
-#define UPRINT_H 1
-
-#include
-
-#include "unicode/utypes.h"
-
-/* Print a ustring to the specified FILE* in the default codepage */
-U_CFUNC void uprint(const UChar *s, FILE *f, UErrorCode *status);
-
-#endif /* ! UPRINT_H */
diff --git a/icu4c/source/samples/case/Makefile b/icu4c/source/samples/case/Makefile
deleted file mode 100644
index 171c922ec9b..00000000000
--- a/icu4c/source/samples/case/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2003 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=case
-
-# All object files (C or C++)
-OBJECTS=case.o ucase.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-LDFLAGS += $(LDFLAGS_USTDIO)
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/case/case.cpp b/icu4c/source/samples/case/case.cpp
deleted file mode 100644
index 578e18436d1..00000000000
--- a/icu4c/source/samples/case/case.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2003-2004, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-
-#include
-#include
-#include
-#include
-
-using namespace icu;
-
-U_CFUNC int c_main(UFILE *out);
-
-void printUnicodeString(UFILE *out, const UnicodeString &s) {
- UnicodeString other = s;
- u_fprintf(out, "\"%S\"", other.getTerminatedBuffer());
-}
-
-
-int main()
-{
- UFILE *out;
- UErrorCode status = U_ZERO_ERROR;
- out = u_finit(stdout, nullptr, nullptr);
- if(!out) {
- fprintf(stderr, "Could not initialize (finit()) over stdout! \n");
- return 1;
- }
- ucnv_setFromUCallBack(u_fgetConverter(out), UCNV_FROM_U_CALLBACK_ESCAPE,
- nullptr, nullptr, nullptr, &status);
- if(U_FAILURE(status)) {
- u_fprintf(out, "Warning- couldn't set the substitute callback - err %s\n", u_errorName(status));
- }
-
- /* End Demo boilerplate */
-
- u_fprintf(out,"ICU Case Mapping Sample Program\n\n");
- u_fprintf(out, "C++ Case Mapping\n\n");
-
- UnicodeString string("This is a test");
- /* lowercase = "istanbul" */
- char16_t lowercase[] = {0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0};
- /* uppercase = "LATIN CAPITAL I WITH DOT ABOVE STANBUL" */
- char16_t uppercase[] = {0x0130, 0x53, 0x54, 0x41, 0x4e, 0x42, 0x55, 0x4C, 0};
-
- UnicodeString upper(uppercase);
- UnicodeString lower(lowercase);
-
- u_fprintf(out, "\nstring: ");
- printUnicodeString(out, string);
- string.toUpper(); /* string = "THIS IS A TEST" */
- u_fprintf(out, "\ntoUpper(): ");
- printUnicodeString(out, string);
- string.toLower(); /* string = "this is a test" */
- u_fprintf(out, "\ntoLower(): ");
- printUnicodeString(out, string);
-
- u_fprintf(out, "\n\nlowercase=%S, uppercase=%S\n", lowercase, uppercase);
-
-
- string = upper;
- string.toLower(Locale("tr", "TR")); /* Turkish lower case map string =
- lowercase */
- u_fprintf(out, "\nupper.toLower: ");
- printUnicodeString(out, string);
-
- string = lower;
- string.toUpper(Locale("tr", "TR")); /* Turkish upper case map string =
- uppercase */
- u_fprintf(out, "\nlower.toUpper: ");
- printUnicodeString(out, string);
-
-
- u_fprintf(out, "\nEnd C++ sample\n\n");
-
- // Call the C version
- int rc = c_main(out);
- u_fclose(out);
- return rc;
-}
-
diff --git a/icu4c/source/samples/case/case.sln b/icu4c/source/samples/case/case.sln
deleted file mode 100644
index 46622a279a8..00000000000
--- a/icu4c/source/samples/case/case.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "case", "case.vcxproj", "{2316BE8C-189D-4C8B-B506-9D9EE25AC46D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|Win32.ActiveCfg = Debug|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|Win32.Build.0 = Debug|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|x64.ActiveCfg = Debug|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Debug|x64.Build.0 = Debug|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|Win32.ActiveCfg = Release|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|Win32.Build.0 = Release|Win32
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|x64.ActiveCfg = Release|x64
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/case/case.vcxproj b/icu4c/source/samples/case/case.vcxproj
deleted file mode 100644
index ab24c9344b3..00000000000
--- a/icu4c/source/samples/case/case.vcxproj
+++ /dev/null
@@ -1,151 +0,0 @@
-п»ї
-
-
- {2316BE8C-189D-4C8B-B506-9D9EE25AC46D}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- Level3
-
-
-
-
- .\x86\Debug/case.tlb
-
-
- MultiThreadedDebugDLL
-
-
- .\x86\Debug/case.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- EditAndContinue
- Default
-
-
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- .\x86\Debug/case.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Debug/case.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/case.tlb
-
-
- MultiThreadedDebugDLL
-
-
- .\x64\Debug/case.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- ProgramDatabase
- Default
-
-
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- .\x64\Debug/case.exe
- true
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/case.pdb
- Console
-
-
-
-
-
-
- .\x86\Release/case.tlb
-
-
- OnlyExplicitInline
- MultiThreadedDLL
- true
-
-
- .\x86\Release/case.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Default
-
-
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- .\x86\Release/case.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Release/case.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/case.tlb
-
-
- OnlyExplicitInline
- MultiThreadedDLL
- true
-
-
- .\x64\Release/case.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Default
-
-
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- .\x64\Release/case.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/case.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/case/case.vcxproj.filters b/icu4c/source/samples/case/case.vcxproj.filters
deleted file mode 100644
index 7dca1cef425..00000000000
--- a/icu4c/source/samples/case/case.vcxproj.filters
+++ /dev/null
@@ -1,25 +0,0 @@
-п»ї
-
-
-
- {43ee3899-8fc9-43ee-afb1-56fc646637b4}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {f8bfa07a-99cc-427e-900b-d224ca9d1a65}
- h;hpp;hxx;hm;inl
-
-
- {4a483140-b33a-4ddb-a2b5-e481b417d590}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/case/readme.txt b/icu4c/source/samples/case/readme.txt
deleted file mode 100644
index df3cb5f973c..00000000000
--- a/icu4c/source/samples/case/readme.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2003-2005, International Business Machines Corporation and others. All Rights Reserved.
-case: case mapping
-
-This sample demonstrates
- Using ICU to convert between different cases
-
-
-Files:
- case.cpp Main source file in C++
- ucase.c Main source file in C
- case.sln Windows MSVC workspace. Double-click this to get started.
- case.vcproj Windows MSVC project file
-
-To Build case on Windows
- 1. Install and build ICU
- 2. In MSVC, open the solution file icu\samples\case\case.sln
- (or, use the workspace All, in icu\samples\all\all.sln )
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the case directory, e.g.
- cd c:\icu\source\samples\case\debug
- 4. Run it
- case
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/case
- gmake ICU_PREFIX=/source/samples/case
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- case
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/case/ucase.c b/icu4c/source/samples/case/ucase.c
deleted file mode 100644
index 3cabe22d606..00000000000
--- a/icu4c/source/samples/case/ucase.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2003-2004, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-****
-*
-* Case folding examples, in C
-*
-*******************************************************************************
-*/
-
-#include
-#include
-
-#include "unicode/uchar.h"
-#include "unicode/ustring.h"
-#include "unicode/utypes.h"
-#include "unicode/ustdio.h"
-
-/* Note: don't use 'k' or 'K' because we might be on EBCDIC */
-
-int c_main(UFILE *out)
-{
- UChar32 ch;
- UErrorCode errorCode = U_ZERO_ERROR;
- static const UChar upper[] = {0x61, 0x42, 0x49, 0}; /* upper = "aBI" */
- static const UChar lower[] = {0x61, 0x42, 0x69, 0}; /* lower = "abi" */
- /* unfold = "aB LATIN SMALL LETTER DOTLESS I" */
- static const UChar unfold[] = {0x61, 0x42, 0x131, 0} ;
- UChar buffer[32];
- const UChar char_k = 0x006b; /* 'k' */
- const UChar char_K = 0x004b; /* 'K' */
-
- int length;
-
- printf("** C Case Mapping Sample\n");
-
- /* uchar.h APIs, single character case mapping */
- ch = u_toupper(char_k); /* ch = 'K' */
- u_fprintf(out, "toupper(%C) = %C\n", char_k, ch);
- ch = u_tolower(ch); /* ch = 'k' */
- u_fprintf(out, "tolower() = %C\n", ch);
- ch = u_totitle(char_k); /* ch = 'K' */
- u_fprintf(out, "totitle(%C) = %C\n", char_k, ch);
- ch = u_foldCase(char_K, U_FOLD_CASE_DEFAULT); /* ch = 'k' */
- u_fprintf(out, "u_foldCase(%C, U_FOLD_CASE_DEFAULT) = %C\n", char_K, (UChar) ch);
-
- /* ustring.h APIs, UChar * string case mapping with a Turkish locale */
- /* result buffer = "ab?" latin small letter a, latin small letter b, latin
- small letter dotless i */
- length = u_strToLower(buffer, sizeof(buffer)/sizeof(buffer[0]), upper,
- sizeof(upper)/sizeof(upper[0]), "tr", &errorCode);
- if(U_FAILURE(errorCode) || buffer[length]!=0) {
- u_fprintf(out, "error in u_strToLower(Turkish locale)=%ld error=%s\n", length,
- u_errorName(errorCode));
- }
-
- u_fprintf(out, "u_strToLower(%S, turkish) -> %S\n", upper, buffer);
-
-
- /* ustring.h APIs, UChar * string case mapping with a English locale */
- /* result buffer = "ABI" latin CAPITAL letter A, latin capital letter B,
- latin capital letter I */
- length = u_strToUpper(buffer, sizeof(buffer)/sizeof(buffer[0]), upper,
- sizeof(upper)/sizeof(upper[0]), "en", &errorCode);
- if(U_FAILURE(errorCode) || buffer[length]!=0) {
- u_fprintf(out, "error in u_strToLower(English locale)=%ld error=%s\n", length,
- u_errorName(errorCode));
- }
- u_fprintf(out, "u_strToUpper(%S, english) -> %S\n", lower, buffer);
-
-
- /* ustring.h APIs, UChar * string case folding */
- /* result buffer = "abi" */
- length = u_strFoldCase(buffer, sizeof(buffer)/sizeof(buffer[0]), unfold,
- sizeof(unfold)/sizeof(unfold[0]), U_FOLD_CASE_DEFAULT,
- &errorCode);
- if(U_FAILURE(errorCode) || buffer[length]!=0) {
- u_fprintf(out, "error in u_strFoldCase()=%ld error=%s\n", length,
- u_errorName(errorCode));
- }
- u_fprintf(out, "u_strFoldCase(%S, U_FOLD_CASE_DEFAULT) -> %S\n", unfold, buffer);
- u_fprintf(out, "\n** end of C sample\n");
-
- return 0;
-}
diff --git a/icu4c/source/samples/citer/Makefile b/icu4c/source/samples/citer/Makefile
deleted file mode 100644
index 14b87e08000..00000000000
--- a/icu4c/source/samples/citer/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2003-2005 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-# Name of your target
-TARGET=citer
-
-# All object files (C or C++)
-OBJECTS=citer.o
-
-# Load in standard makefile definitions
-include ../defs.mk
-
-LDFLAGS += $(LDFLAGS_USTDIO)
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/citer/citer.cpp b/icu4c/source/samples/citer/citer.cpp
deleted file mode 100644
index d9a095f3f30..00000000000
--- a/icu4c/source/samples/citer/citer.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2002-2011, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-
-#include "unicode/uchriter.h"
-#include "unicode/schriter.h"
-#include "unicode/ustring.h"
-#include
-#include
-#include
-#include
-
-static UFILE *out;
-
-using icu::CharacterIterator;
-using icu::StringCharacterIterator;
-using icu::UCharCharacterIterator;
-using icu::UnicodeString;
-
-void printUnicodeString(const UnicodeString &s)
-{
- u_fprintf(out, "%S", &s);
-}
-
-void printUChar(UChar32 ch)
-{
- if(ch < 127) {
- u_fprintf(out, "%C", (char16_t) ch);
- } else if (ch == CharacterIterator::DONE) {
- u_fprintf(out, "[CharacterIterator::DONE = 0xFFFF]");
- } else {
- u_fprintf(out, "[%X]", ch);
- }
-}
-
-class Test
-{
-public:
- void TestUChariter();
- void TestStringiter();
-};
-
-void Test::TestUChariter() {
- const char testChars[] = "Now is the time for all good men to come "
- "to the aid of their country.";
-
- UnicodeString testString(testChars,"");
- const char16_t *testText = testString.getTerminatedBuffer();
-
- UCharCharacterIterator iter(testText, u_strlen(testText));
- UCharCharacterIterator* test2 = iter.clone();
-
- u_fprintf(out, "testText = %s", testChars);
-
- if (iter != *test2 ) {
- u_fprintf(out, "clone() or equals() failed: Two clones tested unequal\n");
- }
-
- UnicodeString result1, result2;
- // getting and comparing the text within the iterators
- iter.getText(result1);
- test2->getText(result2);
- if (result1 != result2) {
- u_fprintf(out, "iter.getText() != clone.getText()\n");
- }
-
- u_fprintf(out, "\n");
-
- // Demonstrates seeking forward using the iterator.
- u_fprintf(out, "Forward = ");
-
- char16_t c = iter.first();
- printUChar(c); // The first char
- int32_t i = 0;
-
- if (iter.startIndex() != 0 || iter.endIndex() != u_strlen(testText)) {
- u_fprintf(out, "startIndex() or endIndex() failed\n");
- }
-
-
- // Testing forward iteration...
- do {
- if (c == CharacterIterator::DONE && i != u_strlen(testText)) {
- u_fprintf(out, "Iterator reached end prematurely");
- }
- else if (c != testText[i]) {
- u_fprintf(out, "Character mismatch at position %d\n", i);
- }
- if (iter.current() != c) {
- u_fprintf(out, "current() isn't working right");
- }
- if (iter.getIndex() != i) {
- u_fprintf(out, "getIndex() isn't working right\n");
- }
- if (c != CharacterIterator::DONE) {
- c = iter.next();
- i++;
- }
-
- u_fprintf(out, "|");
- printUChar(c);
-
- } while (c != CharacterIterator::DONE);
-
- delete test2;
- u_fprintf(out, "\n");
-}
-
-
-void Test::TestStringiter() {
- const char testChars[] = "Now is the time for all good men to come "
- "to the aid of their country.";
-
- UnicodeString testString(testChars,"");
- const char16_t *testText = testString.getTerminatedBuffer();
-
- StringCharacterIterator iter(testText, u_strlen(testText));
- StringCharacterIterator* test2 = iter.clone();
-
- if (iter != *test2 ) {
- u_fprintf(out, "clone() or equals() failed: Two clones tested unequal\n");
- }
-
- UnicodeString result1, result2;
- // getting and comparing the text within the iterators
- iter.getText(result1);
- test2->getText(result2);
- if (result1 != result2) {
- u_fprintf(out, "getText() failed\n");
- }
-
- u_fprintf(out, "Backwards: ");
-
- char16_t c = iter.last();
- int32_t i = iter.endIndex();
-
- printUChar(c);
- i--; // already printed out the last char
-
- if (iter.startIndex() != 0 || iter.endIndex() != u_strlen(testText)) {
- u_fprintf(out, "startIndex() or endIndex() failed\n");
- }
-
- // Testing backward iteration over a range...
- do {
- if (c == CharacterIterator::DONE) {
- u_fprintf(out, "Iterator reached end prematurely\n");
- }
- else if (c != testText[i]) {
- u_fprintf(out, "Character mismatch at position %d\n", i);
- }
- if (iter.current() != c) {
- u_fprintf(out, "current() isn't working right\n");
- }
- if (iter.getIndex() != i) {
- u_fprintf(out, "getIndex() isn't working right [%d should be %d]\n", iter.getIndex(), i);
- }
- if (c != CharacterIterator::DONE) {
- c = iter.previous();
- i--;
- }
-
- u_fprintf(out, "|");
- printUChar(c);
- } while (c != CharacterIterator::DONE);
-
- u_fprintf(out, "\n");
- delete test2;
-}
-
-/* Creating and using text boundaries */
-int main()
-{
- UErrorCode status = U_ZERO_ERROR;
-
- out = u_finit(stdout, nullptr, nullptr);
-
- u_fprintf(out, "ICU Iteration Sample Program (C++)\n\n");
-
- Test t;
-
- u_fprintf(out, "\n");
- u_fprintf(out, "Test::TestUCharIter()\n");
-
- t.TestUChariter();
-
- u_fprintf(out, "-----\n");
- u_fprintf(out, "Test::TestStringchariter()\n");
-
- t.TestStringiter();
-
- u_fprintf(out, "-----\n");
-
- return 0;
-}
diff --git a/icu4c/source/samples/citer/citer.vcxproj b/icu4c/source/samples/citer/citer.vcxproj
deleted file mode 100644
index c9211442449..00000000000
--- a/icu4c/source/samples/citer/citer.vcxproj
+++ /dev/null
@@ -1,121 +0,0 @@
-п»ї
-
-
- {247E2681-6C84-408B-B40C-5DB50BC5E18F}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- x86\Debug\
- x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
- x86\Release\
- x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- true
- MultiThreadedDebug
-
-
- Level3
- EditAndContinue
-
-
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- .\x86\Debug\citer.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- $(OutDir)citer.pdb
- Console
-
-
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- true
- MultiThreadedDebug
-
-
- Level3
- ProgramDatabase
-
-
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- .\x64\Debug\citer.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- $(OutDir)citer.pdb
- Console
-
-
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreaded
-
-
- Level3
- ProgramDatabase
-
-
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- .\x86\Release\citer.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- Console
- true
-
-
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreaded
-
-
- Level3
- ProgramDatabase
-
-
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- .\x64\Release\citer.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- Console
- true
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/citer/citer.vcxproj.filters b/icu4c/source/samples/citer/citer.vcxproj.filters
deleted file mode 100644
index ee4112d2e00..00000000000
--- a/icu4c/source/samples/citer/citer.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-п»ї
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/citer/readme.txt b/icu4c/source/samples/citer/readme.txt
deleted file mode 100644
index 59ef8b5826d..00000000000
--- a/icu4c/source/samples/citer/readme.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2003-2010, International Business Machines Corporation and others. All Rights Reserved.
-citer: Character Iteration
-
-This sample demonstrates
- Demonstrating ICU's CharacterIterator
-
-
-Files:
- citer.cpp Main source file in C++
- citer.sln Windows MSVC workspace. Double-click this to get started.
- citer.vcproj Windows MSVC project file
-
-To Build citer on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\citer\citer.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the citer directory, e.g.
- cd c:\icu\source\samples\citer\debug
- (note that it may be in a different relative directory than most of the other samples).
- 4. Run it
- citer
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/citer
- gmake ICU_PREFIX=/source/samples/citer
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- citer
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/csdet/Makefile b/icu4c/source/samples/csdet/Makefile
deleted file mode 100644
index 3b70a3a861c..00000000000
--- a/icu4c/source/samples/csdet/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2007 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=csdet
-
-# All object files (C or C++)
-OBJECTS=csdet.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/csdet/csdet.c b/icu4c/source/samples/csdet/csdet.c
deleted file mode 100644
index 5b20dbfe3e9..00000000000
--- a/icu4c/source/samples/csdet/csdet.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-********************************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-********************************************************************************
-********************************************************************************
- * Copyright (C) 2005-2006, International Business Machines
- * Corporation and others. All Rights Reserved.
- *******************************************************************************
- */
-
-#include "unicode/utypes.h"
-#include "unicode/ucsdet.h"
-
-#include
-#include
-
-#define BUFFER_SIZE 8192
-
-int main(int argc, char *argv[])
-{
- static char buffer[BUFFER_SIZE];
- int32_t arg;
-
- if( argc <= 1 ) {
- printf("Usage: %s [filename]...\n", argv[0]);
- return -1;
- }
-
- for(arg = 1; arg < argc; arg += 1) {
- FILE *file;
- char *filename = argv[arg];
- int32_t inputLength, match, matchCount = 0;
- UCharsetDetector* csd;
- const UCharsetMatch **csm;
- UErrorCode status = U_ZERO_ERROR;
-
- if (arg > 1) {
- printf("\n");
- }
-
- file = fopen(filename, "rb");
-
- if (file == NULL) {
- printf("Cannot open file \"%s\"\n\n", filename);
- continue;
- }
-
- printf("%s:\n", filename);
-
- inputLength = (int32_t) fread(buffer, 1, BUFFER_SIZE, file);
-
- fclose(file);
-
- csd = ucsdet_open(&status);
- ucsdet_setText(csd, buffer, inputLength, &status);
-
- csm = ucsdet_detectAll(csd, &matchCount, &status);
-
- for(match = 0; match < matchCount; match += 1) {
- const char *name = ucsdet_getName(csm[match], &status);
- const char *lang = ucsdet_getLanguage(csm[match], &status);
- int32_t confidence = ucsdet_getConfidence(csm[match], &status);
-
- if (lang == NULL || strlen(lang) == 0) {
- lang = "**";
- }
-
- printf("%s (%s) %d\n", name, lang, confidence);
- }
-
- ucsdet_close(csd);
- }
-
- return 0;
-}
-
diff --git a/icu4c/source/samples/csdet/csdet.vcxproj b/icu4c/source/samples/csdet/csdet.vcxproj
deleted file mode 100644
index 234a7b84e68..00000000000
--- a/icu4c/source/samples/csdet/csdet.vcxproj
+++ /dev/null
@@ -1,128 +0,0 @@
-п»ї
-
-
- {683745AD-3BC2-4B89-898B-93490D7F2757}
- Win32Proj
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- x86\Debug\
- x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
- x86\Release\
- x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
-
-
-
- ../../../include;%(AdditionalIncludeDirectories)
- true
- EnableFastChecks
- MultiThreadedDebug
-
-
- Level3
- EditAndContinue
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- $(OutDir)csdet.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- true
- $(OutDir)csdet.pdb
- Console
-
-
-
-
-
-
- X64
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- true
- EnableFastChecks
- MultiThreadedDebug
-
-
- Level3
- ProgramDatabase
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- $(OutDir)csdet.exe
- ../../../lib64;%(AdditionalLibraryDirectories)
- true
- $(OutDir)csdet.pdb
- Console
-
-
-
-
-
-
- ../../../include;%(AdditionalIncludeDirectories)
- MultiThreaded
-
-
- Level3
- ProgramDatabase
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- $(OutDir)csdet.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- true
- Console
- true
-
-
-
-
-
-
- ../../../include;%(AdditionalIncludeDirectories)
- MultiThreaded
-
-
- Level3
- ProgramDatabase
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- $(OutDir)csdet.exe
- ../../../lib64;%(AdditionalLibraryDirectories)
- true
- Console
- true
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/csdet/csdet.vcxproj.filters b/icu4c/source/samples/csdet/csdet.vcxproj.filters
deleted file mode 100644
index 5db334a0be3..00000000000
--- a/icu4c/source/samples/csdet/csdet.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-п»ї
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/csdet/readme.txt b/icu4c/source/samples/csdet/readme.txt
deleted file mode 100644
index 550dfe90460..00000000000
--- a/icu4c/source/samples/csdet/readme.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2001-2010 International Business Machines
-Corporation and others. All Rights Reserved.
-uresb: Resource Bundle
-
-This sample demonstrates
- Using ICU's CharSet Detection API
-
-
-Files:
- csdet.c Main source file
- *.txt Various sample .txt files
-
-To Build uresb on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\uresb\uresb.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the uresb directory, e.g.
- cd c:\icu\source\samples\uresb\debug
- 4. Run it (with a locale name, ex. english)
- csdet eucJP.txt
- WARNING: The .txt files must be in the same directory as the executable, which is not the case by default on some systems.
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/uresb
- gmake ICU_PREFIX=
-
- To Run on Unixes
- cd /source/samples/uresb
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- csdet eucJP.txt
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/date/Makefile.in b/icu4c/source/samples/date/Makefile.in
deleted file mode 100644
index cbc020e76b4..00000000000
--- a/icu4c/source/samples/date/Makefile.in
+++ /dev/null
@@ -1,78 +0,0 @@
-## Copyright (C) 2016 and later: Unicode, Inc. and others.
-## License & terms of use: http://www.unicode.org/copyright.html
-##
-## Makefile.in for ICU - samples/date
-## Copyright (c) 1999-2012, International Business Machines Corporation and
-## others. All Rights Reserved.
-
-## Source directory information
-
-srcdir=@srcdir@
-top_srcdir=@top_srcdir@
-
-top_builddir = ../..
-
-include $(top_builddir)/icudefs.mk
-
-## Build directory information
-subdir = samples/date
-
-## Extra files to remove for 'make clean'
-CLEANFILES = *~ $(DEPS)
-
-## Target information
-TARGET = icudate$(EXEEXT)
-
-CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
-LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
-
-OBJECTS = uprint.o date.o
-
-DEPS = $(OBJECTS:.o=.d)
-
-## List of phony targets
-.PHONY : all all-local install install-local clean clean-local \
-distclean distclean-local dist dist-local check check-local
-
-## Clear suffix list
-.SUFFIXES :
-
-## List of standard targets
-all: all-local
-install: install-local
-clean: clean-local
-distclean : distclean-local
-dist: dist-local
-check: all check-local
-
-all-local: $(TARGET)
-
-install-local: all-local
-
-dist-local:
-
-clean-local:
- test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
- $(RMV) $(OBJECTS) $(TARGET)
-
-distclean-local: clean-local
- $(RMV) Makefile
-
-check-local:
- -$(INVOKE) ./$(TARGET) $(ICUDATE_OPTS)
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(TARGET) : $(OBJECTS)
- $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
- $(POST_BUILD_STEP)
-
-ifeq (,$(MAKECMDGOALS))
--include $(DEPS)
-else
-ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
--include $(DEPS)
-endif
-endif
diff --git a/icu4c/source/samples/date/date.c b/icu4c/source/samples/date/date.c
deleted file mode 100644
index 065ec71bf84..00000000000
--- a/icu4c/source/samples/date/date.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
-*************************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*************************************************************************
-***********************************************************************
-* Copyright (C) 1998-2012, International Business Machines
-* Corporation and others. All Rights Reserved.
-**********************************************************************
-*
-* File date.c
-*
-* Modification History:
-*
-* Date Name Description
-* 06/11/99 stephen Creation.
-* 06/16/99 stephen Modified to use uprint.
-* 08/11/11 srl added Parse and milli/second in/out
-*******************************************************************************
-*/
-
-#include
-#include
-#include
-#include
-
-#include "unicode/utypes.h"
-#include "unicode/ustring.h"
-#include "unicode/uclean.h"
-
-#include "unicode/ucnv.h"
-#include "unicode/udat.h"
-#include "unicode/ucal.h"
-
-#include "uprint.h"
-
-int main(int argc, char **argv);
-
-#if UCONFIG_NO_FORMATTING || UCONFIG_NO_CONVERSION
-
-int main(int argc, char **argv)
-{
- printf("%s: Sorry, UCONFIG_NO_FORMATTING or UCONFIG_NO_CONVERSION was turned on (see uconfig.h). No formatting can be done. \n", argv[0]);
- return 0;
-}
-#else
-
-
-/* Protos */
-static void usage(void);
-static void version(void);
-static void date(UDate when, const UChar *tz, UDateFormatStyle style, const char *format, const char *locale, UErrorCode *status);
-static UDate getWhen(const char *millis, const char *seconds, const char *format, const char *locale, UDateFormatStyle style, const char *parse, const UChar *tz, UErrorCode *status);
-
-UConverter *cnv = NULL;
-
-/* The version of date */
-#define DATE_VERSION "1.0"
-
-/* "GMT" */
-static const UChar GMT_ID [] = { 0x0047, 0x004d, 0x0054, 0x0000 };
-
-#define FORMAT_MILLIS "%"
-#define FORMAT_SECONDS "%%"
-
-int
-main(int argc,
- char **argv)
-{
- int printUsage = 0;
- int printVersion = 0;
- int optInd = 1;
- char *arg;
- const UChar *tz = 0;
- UDateFormatStyle style = UDAT_DEFAULT;
- UErrorCode status = U_ZERO_ERROR;
- const char *format = NULL;
- const char *locale = NULL;
- char *parse = NULL;
- char *seconds = NULL;
- char *millis = NULL;
- UDate when;
-
- /* parse the options */
- for(optInd = 1; optInd < argc; ++optInd) {
- arg = argv[optInd];
-
- /* version info */
- if(strcmp(arg, "-v") == 0 || strcmp(arg, "--version") == 0) {
- printVersion = 1;
- }
- /* usage info */
- else if(strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) {
- printUsage = 1;
- }
- /* display date in gmt */
- else if(strcmp(arg, "-u") == 0 || strcmp(arg, "--gmt") == 0) {
- tz = GMT_ID;
- }
- /* display date in gmt */
- else if(strcmp(arg, "-f") == 0 || strcmp(arg, "--full") == 0) {
- style = UDAT_FULL;
- }
- /* display date in long format */
- else if(strcmp(arg, "-l") == 0 || strcmp(arg, "--long") == 0) {
- style = UDAT_LONG;
- }
- /* display date in medium format */
- else if(strcmp(arg, "-m") == 0 || strcmp(arg, "--medium") == 0) {
- style = UDAT_MEDIUM;
- }
- /* display date in short format */
- else if(strcmp(arg, "-s") == 0 || strcmp(arg, "--short") == 0) {
- style = UDAT_SHORT;
- }
- else if(strcmp(arg, "-F") == 0 || strcmp(arg, "--format") == 0) {
- if ( optInd + 1 < argc ) {
- optInd++;
- format = argv[optInd];
- }
- } else if(strcmp(arg, "-r") == 0) {
- if ( optInd + 1 < argc ) {
- optInd++;
- seconds = argv[optInd];
- }
- } else if(strcmp(arg, "-R") == 0) {
- if ( optInd + 1 < argc ) {
- optInd++;
- millis = argv[optInd];
- }
- } else if(strcmp(arg, "-P") == 0) {
- if ( optInd + 1 < argc ) {
- optInd++;
- parse = argv[optInd];
- }
- }
- else if (strcmp(arg, "-L") == 0) {
- if (optInd + 1 < argc) {
- optInd++;
- locale = argv[optInd];
- }
- }
- /* POSIX.1 says all arguments after -- are not options */
- else if(strcmp(arg, "--") == 0) {
- /* skip the -- */
- ++optInd;
- break;
- }
- /* unrecognized option */
- else if(strncmp(arg, "-", strlen("-")) == 0) {
- printf("icudate: invalid option -- %s\n", arg+1);
- printUsage = 1;
- }
- /* done with options, display date */
- else {
- break;
- }
- }
-
- /* print usage info */
- if(printUsage) {
- usage();
- return 0;
- }
-
- /* print version info */
- if(printVersion) {
- version();
- return 0;
- }
-
- /* get the 'when' (or now) */
- when = getWhen(millis, seconds, format, locale, style, parse, tz, &status);
- if(parse != NULL) {
- format = FORMAT_MILLIS; /* output in millis */
- }
-
- /* print the date */
- date(when, tz, style, format, locale, &status);
-
- ucnv_close(cnv);
-
- u_cleanup();
- return (U_FAILURE(status) ? 1 : 0);
-}
-
-/* Usage information */
-static void
-usage(void)
-{
- puts("Usage: icudate [OPTIONS]");
- puts("Options:");
- puts(" -h, --help Print this message and exit.");
- puts(" -v, --version Print the version number of date and exit.");
- puts(" -u, --gmt Display the date in Greenwich Mean Time.");
- puts(" -f, --full Use full display format.");
- puts(" -l, --long Use long display format.");
- puts(" -m, --medium Use medium display format.");
- puts(" -s, --short Use short display format.");
- puts(" -F , --format Use as the display format.");
- puts(" (Special formats: \"%\" alone is Millis since 1970, \"%%\" alone is Seconds since 1970)");
- puts(" -r Use as the time (Epoch 1970) rather than now.");
- puts(" -R Use as the time (Epoch 1970) rather than now.");
- puts(" -P Parse as the time, output in millis format.");
- puts(" -L Use the locale instead of the default ICU locale.");
-}
-
-/* Version information */
-static void
-version(void)
-{
- UErrorCode status = U_ZERO_ERROR;
- const char *tzVer;
- int len = 256;
- UChar tzName[256];
- printf("icudate version %s, created by Stephen F. Booth.\n",
- DATE_VERSION);
- puts(U_COPYRIGHT_STRING);
- tzVer = ucal_getTZDataVersion(&status);
- if(U_FAILURE(status)) {
- tzVer = u_errorName(status);
- }
- printf("\n");
- printf("ICU Version: %s\n", U_ICU_VERSION);
- printf("ICU Data (major+min): %s\n", U_ICUDATA_NAME);
- printf("Default Locale: %s\n", uloc_getDefault());
- printf("Time Zone Data Version: %s\n", tzVer);
- printf("Default Time Zone: ");
- status = U_ZERO_ERROR;
- u_init(&status);
- len = ucal_getDefaultTimeZone(tzName, len, &status);
- if(U_FAILURE(status)) {
- fprintf(stderr, " ** Error getting default zone: %s\n", u_errorName(status));
- }
- uprint(tzName, stdout, &status);
- printf("\n\n");
-}
-
-static int32_t charsToUCharsDefault(UChar *uchars, int32_t ucharsSize, const char*chars, int32_t charsSize, UErrorCode *status) {
- int32_t len=-1;
- if(U_FAILURE(*status)) return len;
- if(cnv==NULL) {
- cnv = ucnv_open(NULL, status);
- }
- if(cnv&&U_SUCCESS(*status)) {
- len = ucnv_toUChars(cnv, uchars, ucharsSize, chars,charsSize, status);
- }
- return len;
-}
-
-/* Format the date */
-static void
-date(UDate when,
- const UChar *tz,
- UDateFormatStyle style,
- const char *format,
- const char *locale,
- UErrorCode *status )
-{
- UChar *s = 0;
- int32_t len = 0;
- UDateFormat *fmt;
- UChar uFormat[100];
-
- if(U_FAILURE(*status)) return;
-
- if( format != NULL ) {
- if(!strcmp(format,FORMAT_MILLIS)) {
- printf("%.0f\n", when);
- return;
- } else if(!strcmp(format, FORMAT_SECONDS)) {
- printf("%.3f\n", when/1000.0);
- return;
- }
- }
-
- fmt = udat_open(style, style, locale, tz, -1,NULL,0, status);
- if ( format != NULL ) {
- charsToUCharsDefault(uFormat,sizeof(uFormat)/sizeof(uFormat[0]),format,-1,status);
- udat_applyPattern(fmt,false,uFormat,-1);
- }
- len = udat_format(fmt, when, 0, len, 0, status);
- if(*status == U_BUFFER_OVERFLOW_ERROR) {
- *status = U_ZERO_ERROR;
- s = (UChar*) malloc(sizeof(UChar) * (len+1));
- if(s == 0) goto finish;
- udat_format(fmt, when, s, len + 1, 0, status);
- }
- if(U_FAILURE(*status)) goto finish;
-
- /* print the date string */
- uprint(s, stdout, status);
-
- /* print a trailing newline */
- printf("\n");
-
- finish:
- if(U_FAILURE(*status)) {
- fprintf(stderr, "Error in Print: %s\n", u_errorName(*status));
- }
- udat_close(fmt);
- free(s);
-}
-
-static UDate getWhen(const char *millis, const char *seconds, const char *format, const char *locale,
- UDateFormatStyle style, const char *parse, const UChar *tz, UErrorCode *status) {
- UDateFormat *fmt = NULL;
- UChar uFormat[100];
- UChar uParse[256];
- UDate when=0;
- int32_t parsepos = 0;
-
- if(millis != NULL) {
- sscanf(millis, "%lf", &when);
- return when;
- } else if(seconds != NULL) {
- sscanf(seconds, "%lf", &when);
- return when*1000.0;
- }
-
- if(parse!=NULL) {
- if( format != NULL ) {
- if(!strcmp(format,FORMAT_MILLIS)) {
- sscanf(parse, "%lf", &when);
- return when;
- } else if(!strcmp(format, FORMAT_SECONDS)) {
- sscanf(parse, "%lf", &when);
- return when*1000.0;
- }
- }
-
- fmt = udat_open(style, style, locale, tz, -1,NULL,0, status);
- if ( format != NULL ) {
- charsToUCharsDefault(uFormat,sizeof(uFormat)/sizeof(uFormat[0]), format,-1,status);
- udat_applyPattern(fmt,false,uFormat,-1);
- }
-
- charsToUCharsDefault(uParse,sizeof(uParse)/sizeof(uParse[0]), parse,-1,status);
- when = udat_parse(fmt, uParse, -1, &parsepos, status);
- if(U_FAILURE(*status)) {
- fprintf(stderr, "Error in Parse: %s\n", u_errorName(*status));
- if(parsepos > 0 && parsepos <= (int32_t)strlen(parse)) {
- fprintf(stderr, "ERR>\"%s\" @%d\n"
- "ERR> %*s^\n",
- parse,parsepos,parsepos,"");
-
- }
- }
-
- udat_close(fmt);
- return when;
- } else {
- return ucal_getNow();
- }
-}
-
-#endif
diff --git a/icu4c/source/samples/date/date.sln b/icu4c/source/samples/date/date.sln
deleted file mode 100644
index 0ec4cd58413..00000000000
--- a/icu4c/source/samples/date/date.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "date", "date.vcxproj", "{38B5751A-C6F9-4409-950C-F4F9DA17275F}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|Win32.ActiveCfg = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|Win32.Build.0 = Debug|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.ActiveCfg = Debug|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Debug|x64.Build.0 = Debug|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|Win32.ActiveCfg = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|Win32.Build.0 = Release|Win32
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.ActiveCfg = Release|x64
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/date/date.vcxproj b/icu4c/source/samples/date/date.vcxproj
deleted file mode 100644
index 3d20f9576ed..00000000000
--- a/icu4c/source/samples/date/date.vcxproj
+++ /dev/null
@@ -1,154 +0,0 @@
-п»ї
-
-
- {38B5751A-C6F9-4409-950C-F4F9DA17275F}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
- .\x86\Release/date.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
- NotUsing
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- true
- Default
-
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x86\Release/date.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- .\x86\Release/date.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/date.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
- NotUsing
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- Default
-
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x64\Release/date.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/date.pdb
- Console
-
-
-
-
-
-
- .\x86\Debug/date.tlb
-
-
- Disabled
- ..\..\..\include;%(AdditionalIncludeDirectories)
- EnableFastChecks
- MultiThreadedDebugDLL
- NotUsing
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- EditAndContinue
- Default
-
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x86\Debug/date.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/date.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/date.tlb
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDebugDLL
- NotUsing
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- ProgramDatabase
- Default
-
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x64\Debug/date.exe
- ../../../lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/date.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/date/date.vcxproj.filters b/icu4c/source/samples/date/date.vcxproj.filters
deleted file mode 100644
index 4c6f43d8646..00000000000
--- a/icu4c/source/samples/date/date.vcxproj.filters
+++ /dev/null
@@ -1,30 +0,0 @@
-п»ї
-
-
-
- {5d1a92f4-cd62-4008-981f-9b9ce42ff51d}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {384d6dc3-d172-42ad-b155-2995c3a6821a}
- h;hpp;hxx;hm;inl
-
-
- {b7a5bc57-56cb-42af-9127-0a3369186ee8}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Header Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/date/readme.txt b/icu4c/source/samples/date/readme.txt
deleted file mode 100644
index 72c46615e52..00000000000
--- a/icu4c/source/samples/date/readme.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002-2010, International Business Machines Corporation and others. All Rights Reserved.
-icudate: a sample program which displays the current date
-
-This sample demonstrates
- Formatting a date
- Outputting text in the default codepage to the console
-
-
-Files:
- date.c Main source file
- uprint.h codepage output convenience header
- uprint.h codepage output convenience implementation
- date.sln Windows MSVC workspace. Double-click this to get started.
- date.vcproj Windows MSVC project file
-
-To Build icudate on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\date\date.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the icudate directory, e.g.
- cd c:\icu\source\samples\date\debug
- 4. Run it (Warning: Be careful, 'date' is also a system command on many systems)
- .\date
-
-To Build on Unixes
- 1. Build ICU. icudate is built automatically by default unless samples are turned off.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- To Run on Unixes
- cd /source/samples/date
-
- gmake check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- date
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/date/uprint.c b/icu4c/source/samples/date/uprint.c
deleted file mode 100644
index f9015805ca5..00000000000
--- a/icu4c/source/samples/date/uprint.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-***********************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-***********************************************************************
-**********************************************************************
-* Copyright (C) 1998-2001, International Business Machines Corporation
-* and others. All Rights Reserved.
-**********************************************************************
-*
-* File date.c
-*
-* Modification History:
-*
-* Date Name Description
-* 06/14/99 stephen Creation.
-*******************************************************************************
-*/
-
-#include "uprint.h"
-
-#include
-#include "unicode/ucnv.h"
-#include "unicode/ustring.h"
-
-#define BUF_SIZE 128
-
-/* Print a ustring to the specified FILE* in the default codepage */
-void
-uprint(const UChar *s,
- FILE *f,
- UErrorCode *status)
-{
- /* converter */
- UConverter *converter;
- char buf [BUF_SIZE];
- int32_t sourceLen;
- const UChar *mySource;
- const UChar *mySourceEnd;
- char *myTarget;
- int32_t arraySize;
-
- if(s == 0) return;
-
- /* set up the conversion parameters */
- sourceLen = u_strlen(s);
- mySource = s;
- mySourceEnd = mySource + sourceLen;
- myTarget = buf;
- arraySize = BUF_SIZE;
-
- /* open a default converter */
- converter = ucnv_open(0, status);
-
- /* if we failed, clean up and exit */
- if(U_FAILURE(*status)) goto finish;
-
- /* perform the conversion */
- do {
- /* reset the error code */
- *status = U_ZERO_ERROR;
-
- /* perform the conversion */
- ucnv_fromUnicode(converter, &myTarget, myTarget + arraySize,
- &mySource, mySourceEnd, NULL,
- true, status);
-
- /* Write the converted data to the FILE* */
- fwrite(buf, sizeof(char), myTarget - buf, f);
-
- /* update the conversion parameters*/
- myTarget = buf;
- arraySize = BUF_SIZE;
- }
- while(*status == U_BUFFER_OVERFLOW_ERROR);
-
- finish:
-
- /* close the converter */
- ucnv_close(converter);
-}
diff --git a/icu4c/source/samples/date/uprint.h b/icu4c/source/samples/date/uprint.h
deleted file mode 100644
index 2f60ecbc090..00000000000
--- a/icu4c/source/samples/date/uprint.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-********************************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-********************************************************************************
-**********************************************************************
-* Copyright (C) 1998-2004, International Business Machines Corporation
-* and others. All Rights Reserved.
-**********************************************************************
-*
-* File uprint.h
-*
-* Modification History:
-*
-* Date Name Description
-* 06/14/99 stephen Creation.
-*******************************************************************************
-*/
-
-#ifndef UPRINT_H
-#define UPRINT_H 1
-
-#include
-
-#include "unicode/utypes.h"
-
-/* Print a ustring to the specified FILE* in the default codepage */
-U_CFUNC void uprint(const UChar *s, FILE *f, UErrorCode *status);
-
-#endif /* ! UPRINT_H */
diff --git a/icu4c/source/samples/datecal/Makefile b/icu4c/source/samples/datecal/Makefile
deleted file mode 100644
index 013992b6642..00000000000
--- a/icu4c/source/samples/datecal/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2006 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=datecal
-
-# All object files (C or C++)
-OBJECTS=cal.o ccal.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-LDFLAGS += $(LDFLAGS_USTDIO)
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/datecal/cal.cpp b/icu4c/source/samples/datecal/cal.cpp
deleted file mode 100644
index 3af2fe1a3ba..00000000000
--- a/icu4c/source/samples/datecal/cal.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2002-2012, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-
-#include "unicode/calendar.h"
-#include "unicode/gregocal.h"
-#include
-
-using namespace icu;
-
-extern "C" void c_main();
-
-void cpp_main()
-{
- UErrorCode status = U_ZERO_ERROR;
- puts("C++ sample");
- GregorianCalendar* gc = new GregorianCalendar(status);
- if (U_FAILURE(status)) {
- puts("Couldn't create GregorianCalendar");
- return;
- }
- /* set up the date */
- gc->set(2000, UCAL_FEBRUARY, 26);
- gc->set(UCAL_HOUR_OF_DAY, 23);
- gc->set(UCAL_MINUTE, 0);
- gc->set(UCAL_SECOND, 0);
- gc->set(UCAL_MILLISECOND, 0);
- /* Iterate through the days and print it out. */
- for (int32_t i = 0; i < 30; i++) {
- /* print out the date. */
- /* You should use the DateFormat to properly format it */
- printf("year: %d, month: %d (%d in the implementation), day: %d\n",
- gc->get(UCAL_YEAR, status),
- gc->get(UCAL_MONTH, status) + 1,
- gc->get(UCAL_MONTH, status),
- gc->get(UCAL_DATE, status));
- if (U_FAILURE(status))
- {
- puts("Calendar::get failed");
- return;
- }
- /* Add a day to the date */
- gc->add(UCAL_DATE, 1, status);
- if (U_FAILURE(status)) {
- puts("Calendar::add failed");
- return;
- }
- }
- delete gc;
-}
-
-
-/* Creating and using text boundaries */
-int main()
-{
- puts("Date-Calendar sample program");
-
- cpp_main();
-
- c_main();
-
- return 0;
-}
-
diff --git a/icu4c/source/samples/datecal/ccal.c b/icu4c/source/samples/datecal/ccal.c
deleted file mode 100644
index b9ce3dece01..00000000000
--- a/icu4c/source/samples/datecal/ccal.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2002-2003, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-
-#include "unicode/ucal.h"
-#include
-
-void c_main()
-{
- puts("----");
- puts("C Sample");
-
-UErrorCode status = U_ZERO_ERROR;
-int32_t i;
-UCalendar *cal = ucal_open(NULL, -1, NULL, UCAL_GREGORIAN, &status);
-if (U_FAILURE(status)) {
- puts("Couldn't create GregorianCalendar");
- return;
- }
- /* set up the date */
- ucal_set(cal, UCAL_YEAR, 2000);
- ucal_set(cal, UCAL_MONTH, UCAL_FEBRUARY); /* FEBRUARY */
- ucal_set(cal, UCAL_DATE, 26);
- ucal_set(cal, UCAL_HOUR_OF_DAY, 23);
- ucal_set(cal, UCAL_MINUTE, 0);
- ucal_set(cal, UCAL_SECOND, 0);
- ucal_set(cal, UCAL_MILLISECOND, 0);
- /* Iterate through the days and print it out. */
- for (i = 0; i < 30; i++) {
- /* print out the date. */
- /* You should use the udat_* API to properly format it */
- printf("year: %d, month: %d (%d in the implementation), day: %d\n",
- ucal_get(cal, UCAL_YEAR, &status),
- ucal_get(cal, UCAL_MONTH, &status) + 1,
- ucal_get(cal, UCAL_MONTH, &status),
- ucal_get(cal, UCAL_DATE, &status));
- if (U_FAILURE(status)) {
- puts("Calendar::get failed");
- return;
- }
- /* Add a day to the date */
- ucal_add(cal, UCAL_DATE, 1, &status);
- if (U_FAILURE(status))
- {
- puts("Calendar::add failed");
- return;
- }
- }
- ucal_close(cal);
-}
diff --git a/icu4c/source/samples/datefmt/Makefile b/icu4c/source/samples/datefmt/Makefile
deleted file mode 100644
index c9032a782f0..00000000000
--- a/icu4c/source/samples/datefmt/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2002 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-# Name of your target
-TARGET=datefmt
-
-# All object files (C or C++)
-OBJECTS=main.o util.o
-
-# Load in standard makefile definitions
-include ../defs.mk
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/datefmt/README.TXT b/icu4c/source/samples/datefmt/README.TXT
deleted file mode 100644
index 2ec4782f783..00000000000
--- a/icu4c/source/samples/datefmt/README.TXT
+++ /dev/null
@@ -1,107 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002-2010, International Business Machines Corporation and others. All Rights Reserved.
-
-IMPORTANT:
-
-This sample was originally intended as an exercise for the ICU Workshop (September 2000).
-The code currently provided in the solution file is the answer to the exercises, each step can still be found in the 'answers' subdirectory.
-
-
-
-** Workshop homepage is:
- http://www.icu-project.org/docs/workshop_2000/agenda.html
-
- #Date/Time/Number Formatting Support
- 9:30am - 10:30am
- Alan Liu
-
- Topics:
- 1. What is the date/time support in ICU?
- 2. What is the timezone support in ICU?
- 3. What kind of formatting and parsing support is available in ICU, i.e.
- NumberFormat, DateFormat, MessageFormat?
-
-
-INSTRUCTIONS
-------------
-
-This exercise was first developed and tested on ICU release 1.6.0, Win32,
-Microsoft Visual C++ 6.0. It should work on other ICU releases and
-other platforms as well.
-
- MSVC:
- Open the file "datefmt.sln" in Microsoft Visual C++.
-
- Unix:
- - Build and install ICU with a prefix, for example '--prefix=/home/srl/ICU'
- - Set the variable ICU_PREFIX=/home/srl/ICU and use GNU make in
- this directory.
- - You may use 'make check' to invoke this sample.
-
-PROBLEMS
---------
-
-Problem 0:
-
- Set up the program, build it, and run it. To start with, the
- program prints out a list of languages.
-
-Problem 1: Basic Date Formatting (Easy)
-
- Create a calendar, and use it to get the UDate for June 4, 1999,
- 0:00 GMT (or any date of your choosing). You will have to create a
- TimeZone (use the createZone() function already defined in main.cpp)
- and a Calendar object, and make the calendar use the time zone.
-
- Once you have the UDate, create a DateFormat object in each of the
- languages in the LANGUAGE array, and display the date in that
- language. Use the DateFormat::createDateInstance() method to create
- the date formatter.
-
-Problem 2: Date Formatting, Specific Time Zone (Medium)
-
- To really localize a time display, one can also specify the time
- zone in which the time should be displayed. For each language,
- also create different time zones from the TIMEZONE list.
-
- To format a date with a specific calendar and zone, you must deal with
- three objects: a DateFormat, a Calendar, and a TimeZone. Each object
- must be linked to another in correct sequence: The Calendar must use
- the TimeZone, and the DateFormat must use the Calendar.
-
- DateFormat =uses=> Calendar =uses=> TimeZone
-
- Use either setFoo() or adoptFoo() methods, depending on where you
- want to have ownership.
-
- NOTE: It's not always desirable to change the time to a local time
- zone before display. For instance, if some even occurs at 0:00 GMT
- on the first of the month, it's probably clearer to just state that.
- Stating that it occurs at 5:00 PM PDT on the day before in the
- summer, and 4:00 PM PST on the day before in the winter will just
- confuse the issue.
-
-
-NOTES
------
-
-To see a list of system TimeZone IDs, use the TimeZone::create-
-AvailableIDs() methods. Alternatively, look at the file
-icu/docs/tz.htm. This has a hyperlinked list of current system zones.
-
-
-ANSWERS
--------
-
-The exercise includes answers. These are in the "answers" directory,
-and are numbered 1, 2, etc.
-
-If you get stuck and you want to move to the next step, copy the
-answers file into the main directory in order to proceed. E.g.,
-"main_1.cpp" contains the original "main.cpp" file. "main_2.cpp"
-contains the "main.cpp" file after problem 1. Etc.
-
-
-Have fun!
diff --git a/icu4c/source/samples/datefmt/answers/main_0.cpp b/icu4c/source/samples/datefmt/answers/main_0.cpp
deleted file mode 100644
index 9bea9b2791f..00000000000
--- a/icu4c/source/samples/datefmt/answers/main_0.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/calendar.h"
-#include "unicode/datefmt.h"
-#include "unicode/uclean.h"
-#include
-#include
-#include "util.h"
-
-/**
- * If the ID supplied to TimeZone is not a valid system ID,
- * TimeZone::createTimeZone() will return a GMT zone object. In order
- * to detect this error, we check the ID of the returned zone against
- * the ID we requested. If they don't match, we fail with an error.
- */
-TimeZone* createZone(const UnicodeString& id) {
- UnicodeString str;
- TimeZone* zone = TimeZone::createTimeZone(id);
- if (zone->getID(str) != id) {
- delete zone;
- printf("Error: TimeZone::createTimeZone(");
- uprintf(id);
- printf(") returned zone with ID ");
- uprintf(str);
- printf("\n");
- exit(1);
- }
- return zone;
-}
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
-
- // The languages in which we will display the date
- static char* LANGUAGE[] = {
- "en", "de", "fr"
- };
- static const int32_t N_LANGUAGE = sizeof(LANGUAGE)/sizeof(LANGUAGE[0]);
-
- // The time zones in which we will display the time
- static char* TIMEZONE[] = {
- "America/Los_Angeles",
- "America/New_York",
- "Europe/Paris",
- "Europe/Berlin"
- };
- static const int32_t N_TIMEZONE = sizeof(TIMEZONE)/sizeof(TIMEZONE[0]);
-
- for (int32_t i=0; i
-#include
-#include "util.h"
-
-/**
- * If the ID supplied to TimeZone is not a valid system ID,
- * TimeZone::createTimeZone() will return a GMT zone object. In order
- * to detect this error, we check the ID of the returned zone against
- * the ID we requested. If they don't match, we fail with an error.
- */
-TimeZone* createZone(const UnicodeString& id) {
- UnicodeString str;
- TimeZone* zone = TimeZone::createTimeZone(id);
- if (zone->getID(str) != id) {
- delete zone;
- printf("Error: TimeZone::createTimeZone(");
- uprintf(id);
- printf(") returned zone with ID ");
- uprintf(str);
- printf("\n");
- exit(1);
- }
- return zone;
-}
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
-
- // The languages in which we will display the date
- static char* LANGUAGE[] = {
- "en", "de", "fr"
- };
- static const int32_t N_LANGUAGE = sizeof(LANGUAGE)/sizeof(LANGUAGE[0]);
-
- // The time zones in which we will display the time
- static char* TIMEZONE[] = {
- "America/Los_Angeles",
- "America/New_York",
- "Europe/Paris",
- "Europe/Berlin"
- };
- static const int32_t N_TIMEZONE = sizeof(TIMEZONE)/sizeof(TIMEZONE[0]);
-
- for (int32_t i=0; i
-#include
-#include "util.h"
-
-/**
- * If the ID supplied to TimeZone is not a valid system ID,
- * TimeZone::createTimeZone() will return a GMT zone object. In order
- * to detect this error, we check the ID of the returned zone against
- * the ID we requested. If they don't match, we fail with an error.
- */
-TimeZone* createZone(const UnicodeString& id) {
- UnicodeString str;
- TimeZone* zone = TimeZone::createTimeZone(id);
- if (zone->getID(str) != id) {
- delete zone;
- printf("Error: TimeZone::createTimeZone(");
- uprintf(id);
- printf(") returned zone with ID ");
- uprintf(str);
- printf("\n");
- exit(1);
- }
- return zone;
-}
-
-int main(int argc, char **argv) {
-
- Calendar *cal;
- TimeZone *zone;
- DateFormat *fmt;
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
- UDate date;
-
- // The languages in which we will display the date
- static char* LANGUAGE[] = {
- "en", "de", "fr"
- };
- static const int32_t N_LANGUAGE = sizeof(LANGUAGE)/sizeof(LANGUAGE[0]);
-
- // The time zones in which we will display the time
- static char* TIMEZONE[] = {
- "America/Los_Angeles",
- "America/New_York",
- "Europe/Paris",
- "Europe/Berlin"
- };
- static const int32_t N_TIMEZONE = sizeof(TIMEZONE)/sizeof(TIMEZONE[0]);
-
- // Create a calendar
- cal = Calendar::createInstance(status);
- check(status, "Calendar::createInstance");
- zone = createZone("GMT"); // Create a GMT zone
- cal->adoptTimeZone(zone);
- cal->clear();
- cal->set(1999, Calendar::JUNE, 4);
- date = cal->getTime(status);
- check(status, "Calendar::getTime");
-
- for (int32_t i=0; iformat(date, str, status);
-
- // Display the formatted date string
- printf("Date (%s): ", LANGUAGE[i]);
- uprintf(escape(str));
- printf("\n\n");
- }
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/datefmt/answers/main_3.cpp b/icu4c/source/samples/datefmt/answers/main_3.cpp
deleted file mode 100644
index 4aba5600d74..00000000000
--- a/icu4c/source/samples/datefmt/answers/main_3.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/calendar.h"
-#include "unicode/datefmt.h"
-#include
-#include
-#include "util.h"
-
-/**
- * If the ID supplied to TimeZone is not a valid system ID,
- * TimeZone::createTimeZone() will return a GMT zone object. In order
- * to detect this error, we check the ID of the returned zone against
- * the ID we requested. If they don't match, we fail with an error.
- */
-TimeZone* createZone(const UnicodeString& id) {
- UnicodeString str;
- TimeZone* zone = TimeZone::createTimeZone(id);
- if (zone->getID(str) != id) {
- delete zone;
- printf("Error: TimeZone::createTimeZone(");
- uprintf(id);
- printf(") returned zone with ID ");
- uprintf(str);
- printf("\n");
- exit(1);
- }
- return zone;
-}
-
-int main(int argc, char **argv) {
-
- Calendar *cal;
- TimeZone *zone;
- DateFormat *fmt;
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
- UDate date;
-
- // The languages in which we will display the date
- static char* LANGUAGE[] = {
- "en", "de", "fr"
- };
- static const int32_t N_LANGUAGE = sizeof(LANGUAGE)/sizeof(LANGUAGE[0]);
-
- // The time zones in which we will display the time
- static char* TIMEZONE[] = {
- "America/Los_Angeles",
- "America/New_York",
- "Europe/Paris",
- "Europe/Berlin"
- };
- static const int32_t N_TIMEZONE = sizeof(TIMEZONE)/sizeof(TIMEZONE[0]);
-
- // Create a calendar
- cal = Calendar::createInstance(status);
- check(status, "Calendar::createInstance");
- zone = createZone("GMT"); // Create a GMT zone
- cal->adoptTimeZone(zone);
- cal->clear();
- cal->set(1999, Calendar::JUNE, 4);
- date = cal->getTime(status);
- check(status, "Calendar::getTime");
-
- for (int32_t i=0; iadoptTimeZone(createZone(TIMEZONE[j]));
- fmt->setCalendar(*cal);
-
- // Format the date
- str.remove();
- fmt->format(date, str, status);
-
- // Display the formatted date string
- printf("Date (%s, %s): ", LANGUAGE[i], TIMEZONE[j]);
- uprintf(escape(str));
- printf("\n\n");
- }
-
- delete fmt;
- }
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/datefmt/datefmt.sln b/icu4c/source/samples/datefmt/datefmt.sln
deleted file mode 100644
index 346439ad1a0..00000000000
--- a/icu4c/source/samples/datefmt/datefmt.sln
+++ /dev/null
@@ -1,27 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datefmt", "datefmt.vcxproj", "{6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|Win32.ActiveCfg = Debug|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|Win32.Build.0 = Debug|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|x64.ActiveCfg = Debug|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Debug|x64.Build.0 = Debug|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|Win32.ActiveCfg = Release|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|Win32.Build.0 = Release|Win32
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|x64.ActiveCfg = Release|x64
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/datefmt/datefmt.vcxproj b/icu4c/source/samples/datefmt/datefmt.vcxproj
deleted file mode 100644
index 00dcd6d6700..00000000000
--- a/icu4c/source/samples/datefmt/datefmt.vcxproj
+++ /dev/null
@@ -1,152 +0,0 @@
-п»ї
-
-
- {6D592DB7-B9C8-4B1B-A1C1-F9A9EB4FD4E4}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
-
-
-
- .\x86\Debug/datefmt.tlb
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDebugDLL
-
-
- .\x86\Debug/datefmt.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- EditAndContinue
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x86\Debug/datefmt.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/datefmt.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/datefmt.tlb
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDebugDLL
-
-
- .\x64\Debug/datefmt.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- ProgramDatabase
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x64\Debug/datefmt.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/datefmt.pdb
- Console
-
-
-
-
-
-
- .\x86\Release/datefmt.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
-
-
- .\x86\Release/datefmt.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x86\Release/datefmt.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Release/datefmt.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/datefmt.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
-
-
- .\x64\Release/datefmt.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x64\Release/datefmt.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/datefmt.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/datefmt/datefmt.vcxproj.filters b/icu4c/source/samples/datefmt/datefmt.vcxproj.filters
deleted file mode 100644
index 4db10cd1454..00000000000
--- a/icu4c/source/samples/datefmt/datefmt.vcxproj.filters
+++ /dev/null
@@ -1,25 +0,0 @@
-п»ї
-
-
-
- {a5cbb044-7694-4d1d-98c1-bb578ee7f1ea}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {aadf5a92-1812-45ce-90a0-e9db3945d7c5}
- h;hpp;hxx;hm;inl
-
-
- {9eff3ddc-6822-4225-81fc-a867b9e592c0}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/datefmt/main.cpp b/icu4c/source/samples/datefmt/main.cpp
deleted file mode 100644
index b7c8a13aa60..00000000000
--- a/icu4c/source/samples/datefmt/main.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/calendar.h"
-#include "unicode/datefmt.h"
-#include
-#include
-#include "util.h"
-
-using namespace icu;
-
-/**
- * If the ID supplied to TimeZone is not a valid system ID,
- * TimeZone::createTimeZone() will return a GMT zone object. In order
- * to detect this error, we check the ID of the returned zone against
- * the ID we requested. If they don't match, we fail with an error.
- */
-TimeZone* createZone(const UnicodeString& id) {
- UnicodeString str;
- TimeZone* zone = TimeZone::createTimeZone(id);
- if (zone->getID(str) != id) {
- delete zone;
- printf("Error: TimeZone::createTimeZone(");
- uprintf(id);
- printf(") returned zone with ID ");
- uprintf(str);
- printf("\n");
- exit(1);
- }
- return zone;
-}
-
-int main(int argc, char **argv) {
-
- Calendar *cal;
- TimeZone *zone;
- DateFormat *fmt;
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
- UDate date;
-
- // The languages in which we will display the date
- static const char* LANGUAGE[] = {
- "en", "de", "fr"
- };
- static const int32_t N_LANGUAGE = sizeof(LANGUAGE)/sizeof(LANGUAGE[0]);
-
- // The time zones in which we will display the time
- static const char* TIMEZONE[] = {
- "America/Los_Angeles",
- "America/New_York",
- "Europe/Paris",
- "Europe/Berlin"
- };
- static const int32_t N_TIMEZONE = sizeof(TIMEZONE)/sizeof(TIMEZONE[0]);
-
- // Create a calendar
- cal = Calendar::createInstance(status);
- check(status, "Calendar::createInstance");
- zone = createZone("GMT"); // Create a GMT zone
- cal->adoptTimeZone(zone);
- cal->clear();
- cal->set(1999, Calendar::JUNE, 4);
- date = cal->getTime(status);
- check(status, "Calendar::getTime");
-
- for (int32_t i=0; iadoptTimeZone(createZone(TIMEZONE[j]));
- fmt->setCalendar(*cal);
-
- // Format the date
- str.remove();
- fmt->format(date, str, status);
-
- // Display the formatted date string
- printf("Date (%s, %s): ", LANGUAGE[i], TIMEZONE[j]);
- uprintf(escape(str));
- printf("\n\n");
- }
-
- delete fmt;
- }
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/datefmt/util.cpp b/icu4c/source/samples/datefmt/util.cpp
deleted file mode 100644
index 576d4ab85e1..00000000000
--- a/icu4c/source/samples/datefmt/util.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unistr.h"
-#include
-#include
-
-using namespace icu;
-
-// Verify that a UErrorCode is successful; exit(1) if not
-void check(UErrorCode& status, const char* msg) {
- if (U_FAILURE(status)) {
- printf("ERROR: %s (%s)\n", u_errorName(status), msg);
- exit(1);
- }
- // printf("Ok: %s\n", msg);
-}
-
-// Append a hex string to the target
-static UnicodeString& appendHex(uint32_t number,
- int8_t digits,
- UnicodeString& target) {
- static const UnicodeString DIGIT_STRING("0123456789ABCDEF");
- while (digits > 0) {
- target += DIGIT_STRING[(number >> ((--digits) * 4)) & 0xF];
- }
- return target;
-}
-
-// Replace nonprintable characters with unicode escapes
-UnicodeString escape(const UnicodeString &source) {
- int32_t i;
- UnicodeString target;
- target += "\"";
- for (i=0; i 0x0A && ch < 0x20) || ch > 0x7E) {
- target += "\\u";
- appendHex(ch, 4, target);
- } else {
- target += ch;
- }
- }
- target += "\"";
- return target;
-}
-
-// Print the given string to stdout
-void uprintf(const UnicodeString &str) {
- char* buf = nullptr;
- int32_t len = str.length();
- // int32_t bufLen = str.extract(0, len, buf); // Preflight
- /* Preflighting seems to be broken now, so assume 1-1 conversion,
- plus some slop. */
- int32_t bufLen = len + 16;
- int32_t actualLen;
- buf = new char[bufLen + 1];
- actualLen = str.extract(0, len, buf/*, bufLen*/); // Default codepage conversion
- buf[actualLen] = 0;
- printf("%s", buf);
- delete[] buf;
-}
diff --git a/icu4c/source/samples/datefmt/util.h b/icu4c/source/samples/datefmt/util.h
deleted file mode 100644
index 27d6c806c1e..00000000000
--- a/icu4c/source/samples/datefmt/util.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unistr.h"
-
-using namespace icu;
-
-// Verify that a UErrorCode is successful; exit(1) if not
-void check(UErrorCode& status, const char* msg);
-
-// Replace nonprintable characters with unicode escapes
-UnicodeString escape(const UnicodeString &source);
-
-// Print the given string to stdout
-void uprintf(const UnicodeString &str);
diff --git a/icu4c/source/samples/dtitvfmtsample/Makefile b/icu4c/source/samples/dtitvfmtsample/Makefile
deleted file mode 100644
index 404c9603c74..00000000000
--- a/icu4c/source/samples/dtitvfmtsample/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2006 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=dtitvfmtsample
-
-# All object files (C or C++)
-OBJECTS=dtitvfmtsample.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-LDFLAGS += $(LDFLAGS_USTDIO)
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.cpp b/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.cpp
deleted file mode 100644
index 912a849ce75..00000000000
--- a/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// В© 2016 and later: Unicode, Inc. and others.
-// License & terms of use: http://www.unicode.org/copyright.html
-/******************************************************************************
-* Copyright (C) 2008-2014, International Business Machines Corporation and
-* others. All Rights Reserved.
-*******************************************************************************
-*/
-//! [dtitvfmtPreDefined1]
-#include
-#include "unicode/dtitvfmt.h"
-#include "unicode/ustdio.h"
-//! [dtitvfmtPreDefined1]
-
-using namespace std;
-using namespace icu;
-
-static void dtitvfmtPreDefined() {
-
- u_printf("===============================================================================\n");
- u_printf(" dtitvfmtPreDefined()\n");
- u_printf("\n");
- u_printf(" Use DateIntervalFormat to get date interval format for pre-defined skeletons:\n");
- u_printf(" yMMMd, MMMMd, jm per locale\n");
- u_printf("===============================================================================\n");
-
- //! [dtitvfmtPreDefined]
- UFILE *out = u_finit(stdout, nullptr, "UTF-8");
- UErrorCode status =U_ZERO_ERROR;
- // create 3 Date Intervals
- UnicodeString data[] = {
- UnicodeString("2007-10-10 10:10:10"),
- UnicodeString("2008-10-10 10:10:10"),
- UnicodeString("2008-11-10 10:10:10"),
- UnicodeString("2008-11-10 15:10:10")
- };
- Calendar *cal = Calendar::createInstance(status);
- cal->set(2007,10,10,10,10,10);
- UDate date1 = cal->getTime(status);
- cal->set(2008,10,10,10,10,10);
- UDate date2 = cal->getTime(status);
- cal->set(2008,11,10,10,10,10);
- UDate date3 = cal->getTime(status);
- cal->set(2008,11,10,15,10,10);
- UDate date4 = cal->getTime(status);
- DateInterval* dtitvsample[] = {
- new DateInterval(date1,date2),
- new DateInterval(date2,date3),
- new DateInterval(date3,date4),
- };
- UnicodeString skeletons[] = {
- UnicodeString("yMMMd"),
- UnicodeString("MMMMd"),
- UnicodeString("jm"),
- UnicodeString("")
- };
- u_fprintf(out,"%-10s%-22s%-22s%-35s%-35s\n", "Skeleton","from","to","Date Interval in en_US","Date Interval in Ja");
- int i=0;
- UnicodeString formatEn,formatJa;
- FieldPosition pos=0;
- for (int j=0; !skeletons[j].isEmpty() ;j++) {
- u_fprintf(out,"%-10S%-22S%-22S",skeletons[j].getTerminatedBuffer(),data[i].getTerminatedBuffer(),data[i+1].getTerminatedBuffer());
- //create a DateIntervalFormat instance for given skeleton, locale
- DateIntervalFormat* dtitvfmtEn = DateIntervalFormat::createInstance(skeletons[j], Locale::getEnglish(),status);
- DateIntervalFormat* dtitvfmtJa = DateIntervalFormat::createInstance(skeletons[j], Locale::getJapanese(),status);
- formatEn.remove();
- formatJa.remove();
- //get the DateIntervalFormat
- dtitvfmtEn->format(dtitvsample[i],formatEn,pos,status);
- dtitvfmtJa->format(dtitvsample[i],formatJa,pos,status);
- u_fprintf(out,"%-35S%-35S\n", formatEn.getTerminatedBuffer(),formatJa.getTerminatedBuffer());
- delete dtitvfmtEn;
- delete dtitvfmtJa;
- i++;
- }
- u_fclose(out);
- //! [dtitvfmtPreDefined]
-}
-
-static void dtitvfmtCustomized() {
-
- u_printf("===============================================================================\n");
- u_printf("\n");
- u_printf(" dtitvfmtCustomized()\n");
- u_printf("\n");
- u_printf(" Use DateIntervalFormat to create customized date interval format for yMMMd, Hm");
- u_printf("\n");
- u_printf("================================================================================\n");
- //! [dtitvfmtCustomized]
- UFILE *out = u_finit(stdout, nullptr, "UTF-8");
- UErrorCode status =U_ZERO_ERROR;
- UnicodeString data[] = {
- UnicodeString("2007-9-10 10:10:10"),
- UnicodeString("2007-10-10 10:10:10"),
- UnicodeString("2007-10-10 22:10:10")
- };
- // to create 2 Date Intervals
- Calendar *cal1 = Calendar::createInstance(status);
- cal1->set(2007,9,10,10,10,10);
- Calendar *cal2 = Calendar::createInstance(status);
- cal2->set(2007,10,10,10,10,10);
- Calendar *cal3 = Calendar::createInstance(status);
- cal3->set(2007,10,10,22,10,10);
- DateInterval* dtitvsample[] = {
- new DateInterval(cal1->getTime(status),cal2->getTime(status)),
- new DateInterval(cal2->getTime(status),cal3->getTime(status))
- };
- UnicodeString skeletons[] = {
- UnicodeString("yMMMd"),
- UnicodeString("Hm"),
- UnicodeString("")
- };
- u_printf("%-10s%-22s%-22s%-45s%-35s\n", "Skeleton", "from","to", "Date Interval in en_US","Date Interval in Ja");
- // Create an empty DateIntervalInfo object
- DateIntervalInfo dtitvinf = DateIntervalInfo(status);
- // Set Date Time internal pattern for MONTH, HOUR_OF_DAY
- dtitvinf.setIntervalPattern("yMMMd", UCAL_MONTH, "y 'Diff' MMM d --- MMM d",status);
- dtitvinf.setIntervalPattern("Hm", UCAL_HOUR_OF_DAY, "yyyy MMM d HH:mm ~ HH:mm",status);
- // Set fallback interval pattern
- dtitvinf.setFallbackIntervalPattern("{0} ~~~ {1}",status);
- // Get the DateIntervalFormat with the custom pattern
- UnicodeString formatEn,formatJa;
- FieldPosition pos=0;
- for (int i=0;i<2;i++){
- for (int j=0;!skeletons[j].isEmpty();j++) {
- u_fprintf(out,"%-10S%-22S%-22S", skeletons[i].getTerminatedBuffer(),data[j].getTerminatedBuffer(), data[j+1].getTerminatedBuffer());
- DateIntervalFormat* dtitvfmtEn = DateIntervalFormat::createInstance(skeletons[i],Locale::getEnglish(),dtitvinf,status);
- DateIntervalFormat* dtitvfmtJa = DateIntervalFormat::createInstance(skeletons[i],Locale::getJapanese(),dtitvinf,status);
- formatEn.remove();
- formatJa.remove();
- dtitvfmtEn->format(dtitvsample[j],formatEn,pos,status);
- dtitvfmtJa->format(dtitvsample[j],formatJa,pos,status);
- u_fprintf(out,"%-45S%-35S\n", formatEn.getTerminatedBuffer(),formatJa.getTerminatedBuffer());
- }
- }
- u_fclose(out);
- //! [dtitvfmtCustomized]
-}
-
-int main (int argc, char* argv[])
-{
- dtitvfmtPreDefined();
- dtitvfmtCustomized();
- return 0;
-}
diff --git a/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj b/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj
deleted file mode 100644
index aea18b217f3..00000000000
--- a/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj
+++ /dev/null
@@ -1,140 +0,0 @@
-п»ї
-
-
- {8945255B-473B-4C47-9425-E92384338CAA}
- samples
-
-
-
-
-
- Application
- true
- Unicode
-
-
- Application
- true
- Unicode
-
-
- Application
- false
- true
- Unicode
-
-
- Application
- false
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- .\x86\Debug\
- .\x86\Debug\
- $(ProjectName)
-
-
- .\x64\Debug\
- .\x64\Debug\
- $(ProjectName)
-
-
- .\x86\Release\
- .\x86\Release\
- $(ProjectName)
-
-
- .\x64\Release\
- .\x64\Release\
- $(ProjectName)
-
-
-
- Level3
- ..\..\..\include;%(AdditionalIncludeDirectories)
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
-
-
- true
- .\x86\Debug/dtitvfmtsample.exe
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- ..\..\..\lib;%(AdditionalLibraryDirectories)
-
-
-
-
- Level3
- ..\..\..\include;%(AdditionalIncludeDirectories)
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
-
-
- true
- .\x64\Debug/dtitvfmtsample.exe
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- ..\..\..\include;%(AdditionalIncludeDirectories)
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
-
-
- true
- true
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- ..\..\..\lib;%(AdditionalLibraryDirectories)
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- ..\..\..\include;%(AdditionalIncludeDirectories)
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
-
-
- true
- true
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj.filters b/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj.filters
deleted file mode 100644
index 93d143f652f..00000000000
--- a/icu4c/source/samples/dtitvfmtsample/dtitvfmtsample.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-п»ї
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/dtptngsample/Makefile b/icu4c/source/samples/dtptngsample/Makefile
deleted file mode 100644
index 95393190014..00000000000
--- a/icu4c/source/samples/dtptngsample/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2006 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=dtptngsample
-
-# All object files (C or C++)
-OBJECTS=dtptngsample.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-LDFLAGS += $(LDFLAGS_USTDIO)
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/dtptngsample/dtptngsample.cpp b/icu4c/source/samples/dtptngsample/dtptngsample.cpp
deleted file mode 100644
index b55f31c50d8..00000000000
--- a/icu4c/source/samples/dtptngsample/dtptngsample.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-// В© 2016 and later: Unicode, Inc. and others.
-// License & terms of use: http://www.unicode.org/copyright.html
-/********************************************************************
- * COPYRIGHT:
- * Copyright (c) 2008-2014, International Business Machines Corporation and
- * others. All Rights Reserved.
- ********************************************************************/
-//! [getBestPatternExample1]
-#include
-#include "unicode/smpdtfmt.h"
-#include "unicode/dtptngen.h"
-#include "unicode/ustdio.h"
-//! [getBestPatternExample1]
-
-using namespace std;
-using namespace icu;
-
-static void getBestPatternExample() {
-
- u_printf("========================================================================\n");
- u_printf(" getBestPatternExample()\n");
- u_printf("\n");
- u_printf(" Use DateTimePatternGenerator to create customized date/time pattern:\n");
- u_printf(" yQQQQ,yMMMM, MMMMd, hhmm, jjmm per locale\n");
- u_printf("========================================================================\n");
- //! [getBestPatternExample]
- UnicodeString skeletons [] = {
- UnicodeString("yQQQQ"), // year + full name of quarter, i.e., 4th quarter 1999
- UnicodeString("yMMMM"), // year + full name of month, i.e., October 1999
- UnicodeString("MMMMd"), // full name of month + day of the month, i.e., October 25
- UnicodeString("hhmm"), // 12-hour-cycle format, i.e., 1:32 PM
- UnicodeString("jjmm"), // preferred hour format for the given locale, i.e., 24-hour-cycle format for fr_FR
- 0,
- };
-
- Locale locales[] = {
- Locale ("en_US"),
- Locale ("fr_FR"),
- Locale ("zh_CN"),
- };
-
- const char* filename = "sample.txt";
- /* open a UTF-8 file for writing */
- UFILE* f = u_fopen(filename, "w", nullptr,"UTF-8");
- UnicodeString dateReturned;
- UErrorCode status =U_ZERO_ERROR;
- Calendar *cal = Calendar::createInstance(status);
- cal->set (1999,9,13,23,58,59);
- UDate date = cal->getTime(status);
- u_fprintf(f, "%-20S%-20S%-20S%-20S\n", UnicodeString("Skeleton").getTerminatedBuffer(),UnicodeString("en_US").getTerminatedBuffer(),UnicodeString("fr_FR").getTerminatedBuffer(),UnicodeString("zh_CN").getTerminatedBuffer());
- for (int i=0;!skeletons[i].isEmpty();i++) {
- u_fprintf(f, "%-20S",skeletons[i].getTerminatedBuffer());
- for (int j=0;jgetBestPattern(skeletons[i],status);
- // Constructs a SimpleDateFormat with the best pattern generated above and the given locale
- SimpleDateFormat *sdf = new SimpleDateFormat(pattern,locales[j],status);
- dateReturned.remove();
- // Get the format of the given date
- sdf->format(date,dateReturned,status);
- /* write Unicode string to file */
- u_fprintf(f, "%-20S", dateReturned.getTerminatedBuffer());
- delete dtfg;
- delete sdf;
- }
- u_fprintf(f,"\n");
- }
- /* close the file resource */
- u_fclose(f);
- delete cal;
- //! [getBestPatternExample]
-}
-
-static void addPatternExample() {
-
- u_printf("========================================================================\n");
- u_printf(" addPatternExample()\n");
- u_printf("\n");
- u_printf(" Use addPattern API to add new '. von' to existing pattern\n");
- u_printf("========================================================================\n");
- //! [addPatternExample]
- UErrorCode status =U_ZERO_ERROR;
- UnicodeString conflictingPattern,dateReturned, pattern;
- Locale locale=Locale::getFrance();
- Calendar *cal = Calendar::createInstance(status);
- cal->set (1999,9,13,23,58,59);
- UDate date = cal->getTime(status);
- // Create an DateTimePatternGenerator instance for the given locale
- DateTimePatternGenerator *dtfg= DateTimePatternGenerator::createInstance(locale,status);
- SimpleDateFormat *sdf = new SimpleDateFormat(dtfg->getBestPattern("MMMMddHmm",status),locale,status);
- // Add '. von' to the existing pattern
- dtfg->addPattern("dd'. von' MMMM", true, conflictingPattern,status);
- // Apply the new pattern
- sdf->applyPattern(dtfg->getBestPattern("MMMMddHmm",status));
- dateReturned = sdf->format(date, dateReturned, status);
- pattern =sdf->toPattern(pattern);
- u_printf("%s\n", "New Pattern for FRENCH: ");
- u_printf("%S\n", pattern.getTerminatedBuffer());
- u_printf("%s\n", "Date Time in new Pattern: ");
- u_printf("%S\n", dateReturned.getTerminatedBuffer());
- delete dtfg;
- delete sdf;
- delete cal;
-
- //! [addPatternExample]
- /* output of the sample code:
- ************************************************************************************************
- New Pattern for FRENCH: dd. 'von' MMMM HH:mm
- Date Time in new Pattern: 13. von octobre 23:58
-
- *************************************************************************************************/
- }
-
-static void replaceFieldTypesExample() {
- // Use repalceFieldTypes API to replace zone 'zzzz' with 'vvvv'
- u_printf("========================================================================\n");
- u_printf(" replaceFieldTypeExample()\n");
- u_printf("\n");
- u_printf(" Use replaceFieldTypes API to replace zone 'zzzz' with 'vvvv'\n");
- u_printf("========================================================================\n");
- //! [replaceFieldTypesExample]
- UFILE *out = u_finit(stdout, nullptr, "UTF-8");
- UErrorCode status =U_ZERO_ERROR;
- UnicodeString pattern,dateReturned;
- Locale locale =Locale::getFrance();
- Calendar *cal = Calendar::createInstance(status);
- cal->set (1999,9,13,23,58,59);
- UDate date = cal->getTime(status);
- TimeZone *zone = TimeZone::createTimeZone(UnicodeString("Europe/Paris"));
- DateTimePatternGenerator *dtfg = DateTimePatternGenerator::createInstance(locale,status);
- SimpleDateFormat *sdf = new SimpleDateFormat("EEEE d MMMM y HH:mm:ss zzzz",locale,status);
- sdf->setTimeZone(*zone);
- pattern = sdf->toPattern(pattern);
- u_fprintf(out, "%S\n", UnicodeString("Pattern before replacement:").getTerminatedBuffer());
- u_fprintf(out, "%S\n", pattern.getTerminatedBuffer());
- dateReturned.remove();
- dateReturned = sdf->format(date, dateReturned, status);
- u_fprintf(out, "%S\n", UnicodeString("Date/Time format in fr_FR:").getTerminatedBuffer());
- u_fprintf(out, "%S\n", dateReturned.getTerminatedBuffer());
- // Replace zone "zzzz" in the pattern with "vvvv"
- UnicodeString newPattern = dtfg->replaceFieldTypes(pattern, "vvvv", status);
- // Apply the new pattern
- sdf->applyPattern(newPattern);
- dateReturned.remove();
- dateReturned = sdf->format(date, dateReturned, status);
- u_fprintf(out, "%S\n", UnicodeString("Pattern after replacement:").getTerminatedBuffer());
- u_fprintf(out, "%S\n", newPattern.getTerminatedBuffer());
- u_fprintf(out, "%S\n", UnicodeString("Date/Time format in fr_FR:").getTerminatedBuffer());
- u_fprintf(out, "%S\n", dateReturned.getTerminatedBuffer());
- delete sdf;
- delete dtfg;
- delete zone;
- delete cal;
- u_fclose(out);
- //! [replaceFieldTypesExample]
- }
-
-int main (int argc, char* argv[])
-{
- getBestPatternExample();
- addPatternExample();
- replaceFieldTypesExample();
- return 0;
-}
diff --git a/icu4c/source/samples/dtptngsample/dtptngsample.vcxproj b/icu4c/source/samples/dtptngsample/dtptngsample.vcxproj
deleted file mode 100644
index 542b3439f03..00000000000
--- a/icu4c/source/samples/dtptngsample/dtptngsample.vcxproj
+++ /dev/null
@@ -1,134 +0,0 @@
-п»ї
-
-
- {115886F0-7DFB-4B8B-BE79-83162EE8713B}
- samples
-
-
-
-
-
- Application
- true
- Unicode
-
-
- Application
- true
- Unicode
-
-
- Application
- false
- true
- Unicode
-
-
- Application
- false
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- .\x86\Debug\
- .\x86\Debug\
- $(ProjectName)
-
-
- .\x64\Debug\
- .\x64\Debug\
- $(ProjectName)
-
-
- .\x86\Release\
- .\x86\Release\
- $(ProjectName)
-
-
- .\x64\Release\
- .\x64\Release\
- $(ProjectName)
-
-
-
- Level3
- ..\..\common;..\..\..\include;%(AdditionalIncludeDirectories)
-
-
- true
- .\x86\debug/dtptngsample.exe
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- ..\..\..\lib;%(AdditionalLibraryDirectories)
-
-
-
-
- Level3
- ..\..\common;..\..\..\include;%(AdditionalIncludeDirectories)
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
-
-
- true
- .\x64\debug/dtptngsample.exe
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- ..\..\..\include;..\..\common;%(AdditionalIncludeDirectories)
-
-
- true
- true
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- ..\..\..\lib;%(AdditionalLibraryDirectories)
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- ..\..\..\include;..\..\common;%(AdditionalIncludeDirectories)
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
-
-
- true
- true
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/dtptngsample/dtptngsample.vcxproj.filters b/icu4c/source/samples/dtptngsample/dtptngsample.vcxproj.filters
deleted file mode 100644
index f2c89e8428d..00000000000
--- a/icu4c/source/samples/dtptngsample/dtptngsample.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-п»ї
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/layout/FontMap.GDI b/icu4c/source/samples/layout/FontMap.GDI
deleted file mode 100644
index 59c59989812..00000000000
--- a/icu4c/source/samples/layout/FontMap.GDI
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (C) 2001-2010, International Business Machines
-# Corporation and others. All Rights Reserved.
-#
-# This is a sample FontMap file for Windows.
-# Fonts are specified by font name, as shown
-# in the "Fonts" folder.
-
- DEVANAGARI: Raghindi
- THAI: Courier MonoThai
- DEFAULT: Code2000
-
diff --git a/icu4c/source/samples/layout/FontMap.Gnome b/icu4c/source/samples/layout/FontMap.Gnome
deleted file mode 100644
index ece82d74e54..00000000000
--- a/icu4c/source/samples/layout/FontMap.Gnome
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (C) 2001-2005, International Business Machines
-# Corporation and others. All Rights Reserved.
-# This is a sample FontMap file for Linux.
-# Fonts are specified by file names.
-
- DEVANAGARI: raghu.ttf
- THAI: angsd___.ttf
- DEFAULT: CODE2000.TTF
diff --git a/icu4c/source/samples/layout/FontMap.cpp b/icu4c/source/samples/layout/FontMap.cpp
deleted file mode 100644
index fb72a9ebf34..00000000000
--- a/icu4c/source/samples/layout/FontMap.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2006, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include
-#include
-#include
-
-#include "unicode/utypes.h"
-#include "unicode/uscript.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEScripts.h"
-#include "layout/LEFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-
-using icu::LEFontInstance;
-using icu::scriptCodeCount;
-
-FontMap::FontMap(const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
- : fPointSize(pointSize), fFontCount(0), fAscent(0), fDescent(0), fLeading(0), fGUISupport(guiSupport)
-{
- le_int32 defaultFont = -1, i, script;
- le_bool haveFonts = false;
-
-/**/
- for (i = 0; i < scriptCodeCount; i += 1) {
- fFontIndices[i] = -1;
- fFontNames[i] = nullptr;
- fFontInstances[i] = nullptr;
- }
- /**/
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- char *c, *scriptName, *fontName, *line, buffer[BUFFER_SIZE];
- FILE *file;
-
- file = fopen(fileName, "r");
-
- if (file == nullptr) {
- sprintf(errorMessage, "Could not open the font map file: %s.", fileName);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- while (fgets(buffer, BUFFER_SIZE, file) != nullptr) {
- UScriptCode scriptCode;
- UErrorCode scriptStatus = U_ZERO_ERROR;
-
- line = strip(buffer);
- if (line[0] == '#' || line[0] == 0) {
- continue;
- }
-
- c = strchr(line, ':');
- c[0] = 0;
-
- fontName = strip(&c[1]);
- scriptName = strip(line);
-
- if (strcmp(scriptName, "DEFAULT") == 0) {
- defaultFont = getFontIndex(fontName);
- haveFonts = true;
- continue;
- }
-
- le_int32 fillCount = uscript_getCode(scriptName, &scriptCode, 1, &scriptStatus);
-
- if (U_FAILURE(scriptStatus) || fillCount <= 0 ||
- scriptStatus == U_USING_FALLBACK_WARNING || scriptStatus == U_USING_DEFAULT_WARNING) {
- sprintf(errorMessage, "The script name %s is invalid.", line);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- continue;
- }
-
- script = (le_int32) scriptCode;
-
- if (fFontIndices[script] >= 0) {
- // FIXME: complain that this is a duplicate entry and bail (?)
- fFontIndices[script] = -1;
- }
-
- fFontIndices[script] = getFontIndex(fontName);
- haveFonts = true;
- }
-
- if (defaultFont >= 0) {
- for (script = 0; script < scriptCodeCount; script += 1) {
- if (fFontIndices[script] < 0) {
- fFontIndices[script] = defaultFont;
- }
- }
- }
-
- if (! haveFonts) {
- sprintf(errorMessage, "The font map file %s does not contain any valid scripts.", fileName);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- status = LE_ILLEGAL_ARGUMENT_ERROR;
- }
-
- fclose(file);
-}
-
-FontMap::~FontMap()
-{
- le_int32 font;
-
- for (font = 0; font < fFontCount; font += 1) {
- if (fFontNames[font] != nullptr) {
- delete[] (char *) fFontNames[font];
- }
- }
-
- for (font = 0; font < fFontCount; font += 1) {
- if (fFontInstances[font] != nullptr) {
- delete fFontInstances[font];
- }
- }
-}
-
-le_int32 FontMap::getFontIndex(const char *fontName)
-{
- le_int32 index;
-
- for (index = 0; index < fFontCount; index += 1) {
- if (strcmp(fontName, fFontNames[index]) == 0) {
- return index;
- }
- }
-
- if (fFontCount < (le_int32) scriptCodeCount) {
- index = fFontCount++;
- } else {
- // The font name table is full. Since there can
- // only be scriptCodeCount fonts in use at once,
- // there should be at least one that's not being
- // referenced; find it and reuse it's index.
-
- for (index = 0; index < fFontCount; index += 1) {
- le_int32 script;
-
- for (script = 0; script < scriptCodeCount; script += 1) {
- if (fFontIndices[script] == index) {
- break;
- }
- }
-
- if (script >= scriptCodeCount) {
- break;
- }
- }
- }
-
- if (index >= scriptCodeCount) {
- return -1;
- }
-
- le_int32 len = strlen(fontName);
- char *s = new char[len + 1];
-
- fFontNames[index] = strcpy(s, fontName);
- return index;
-}
-
-char *FontMap::strip(char *s)
-{
- le_int32 start, end, len;
-
- start = 0;
- len = strlen(s);
-
- while (start < len && isspace(s[start])) {
- start += 1;
- }
-
- end = len - 1;
-
- while (end > start && isspace(s[end])) {
- end -= 1;
- }
-
- if (end < len) {
- s[end + 1] = '\0';
- }
-
- return &s[start];
-}
-
-const LEFontInstance *FontMap::getScriptFont(le_int32 scriptCode, LEErrorCode &status)
-{
- if (LE_FAILURE(status)) {
- return nullptr;
- }
-
- if (scriptCode <= -1 || scriptCode >= scriptCodeCount) {
- status = LE_ILLEGAL_ARGUMENT_ERROR;
- return nullptr;
- }
-
-
- le_int32 fontIndex = fFontIndices[scriptCode];
-
- if (fontIndex < 0) {
- sprintf(errorMessage, "No font was set for script %s", uscript_getName((UScriptCode) scriptCode));
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return nullptr;
- }
-
- if (fFontInstances[fontIndex] == nullptr) {
- fFontInstances[fontIndex] = openFont(fFontNames[fontIndex], fPointSize, status);
-
- if (LE_FAILURE(status)) {
- sprintf(errorMessage, "Could not open font file %s", fFontNames[fontIndex]);
- fGUISupport->postErrorMessage(errorMessage, "Font Map Error");
- return nullptr;
- }
- }
-
- return fFontInstances[fontIndex];
-}
-
-le_int32 FontMap::getAscent() const
-{
- if (fAscent <= 0) {
- ((FontMap *) this)->getMaxMetrics();
- }
-
- return fAscent;
-}
-
-le_int32 FontMap::getDescent() const
-{
- if (fDescent <= 0) {
- ((FontMap *) this)->getMaxMetrics();
- }
-
- return fDescent;
-}
-
-le_int32 FontMap::getLeading() const
-{
- if (fLeading <= 0) {
- ((FontMap *) this)->getMaxMetrics();
- }
-
- return fLeading;
-}
-
-void FontMap::getMaxMetrics()
-{
- for (le_int32 i = 0; i < fFontCount; i += 1) {
- LEErrorCode status = LE_NO_ERROR;
- le_int32 ascent, descent, leading;
-
- if (fFontInstances[i] == nullptr) {
- fFontInstances[i] = openFont(fFontNames[i], fPointSize, status);
-
- if (LE_FAILURE(status)) {
- continue;
- }
- }
-
- ascent = fFontInstances[i]->getAscent();
- descent = fFontInstances[i]->getDescent();
- leading = fFontInstances[i]->getLeading();
-
- if (ascent > fAscent) {
- fAscent = ascent;
- }
-
- if (descent > fDescent) {
- fDescent = descent;
- }
-
- if (leading > fLeading) {
- fLeading = leading;
- }
- }
-}
-
diff --git a/icu4c/source/samples/layout/FontMap.h b/icu4c/source/samples/layout/FontMap.h
deleted file mode 100644
index 974458858b3..00000000000
--- a/icu4c/source/samples/layout/FontMap.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __FONTMAP_H
-#define __FONTMAP_H
-
-#include "layout/LETypes.h"
-#include "layout/LEScripts.h"
-#include "layout/LEFontInstance.h"
-
-#include "GUISupport.h"
-
-using icu::LEFontInstance;
-using icu::scriptCodeCount;
-
-#define BUFFER_SIZE 128
-
-class FontMap
-{
-public:
- FontMap(const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
-
- virtual ~FontMap();
-
- virtual const LEFontInstance *getScriptFont(le_int32 scriptCode, LEErrorCode &status);
-
- virtual le_int16 getPointSize() const;
-
- virtual le_int32 getAscent() const;
-
- virtual le_int32 getDescent() const;
-
- virtual le_int32 getLeading() const;
-
-protected:
- virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status) = 0;
-
- char errorMessage[256];
-
-private:
- static char *strip(char *s);
- le_int32 getFontIndex(const char *fontName);
- void getMaxMetrics();
-
- le_int16 fPointSize;
- le_int32 fFontCount;
-
- le_int32 fAscent;
- le_int32 fDescent;
- le_int32 fLeading;
-
- GUISupport *fGUISupport;
-
- const LEFontInstance *fFontInstances[scriptCodeCount];
- const char *fFontNames[scriptCodeCount];
- le_int32 fFontIndices[scriptCodeCount];
-};
-
-inline le_int16 FontMap::getPointSize() const
-{
- return fPointSize;
-}
-
-#endif
-
diff --git a/icu4c/source/samples/layout/FontTableCache.cpp b/icu4c/source/samples/layout/FontTableCache.cpp
deleted file mode 100644
index 5429304137b..00000000000
--- a/icu4c/source/samples/layout/FontTableCache.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *************************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * Copyright (C) 2003 - 2008, International Business Machines
- * Corporation and others. All Rights Reserved.
- *************************************************************************
- */
-
-#include "layout/LETypes.h"
-
-#include "FontTableCache.h"
-
-#define TABLE_CACHE_INIT 5
-#define TABLE_CACHE_GROW 5
-
-struct FontTableCacheEntry
-{
- LETag tag;
- const void *table;
-};
-
-FontTableCache::FontTableCache()
- : fTableCacheCurr(0), fTableCacheSize(TABLE_CACHE_INIT)
-{
- fTableCache = LE_NEW_ARRAY(FontTableCacheEntry, fTableCacheSize);
-
- if (fTableCache == nullptr) {
- fTableCacheSize = 0;
- return;
- }
-
- for (int i = 0; i < fTableCacheSize; i += 1) {
- fTableCache[i].tag = 0;
- fTableCache[i].table = nullptr;
- }
-}
-
-FontTableCache::~FontTableCache()
-{
- for (int i = fTableCacheCurr - 1; i >= 0; i -= 1) {
- freeFontTable(fTableCache[i].table);
-
- fTableCache[i].tag = 0;
- fTableCache[i].table = nullptr;
- }
-
- fTableCacheCurr = 0;
-
- LE_DELETE_ARRAY(fTableCache);
- fTableCache = nullptr;
-}
-
-void FontTableCache::freeFontTable(const void *table) const
-{
- LE_DELETE_ARRAY(table);
-}
-
-const void *FontTableCache::find(LETag tableTag) const
-{
- for (int i = 0; i < fTableCacheCurr; i += 1) {
- if (fTableCache[i].tag == tableTag) {
- return fTableCache[i].table;
- }
- }
-
- const void *table = readFontTable(tableTag);
-
- ((FontTableCache *) this)->add(tableTag, table);
-
- return table;
-}
-
-void FontTableCache::add(LETag tableTag, const void *table)
-{
- if (fTableCacheCurr >= fTableCacheSize) {
- le_int32 newSize = fTableCacheSize + TABLE_CACHE_GROW;
-
- fTableCache = (FontTableCacheEntry *) LE_GROW_ARRAY(fTableCache, newSize);
-
- for (le_int32 i = fTableCacheSize; i < newSize; i += 1) {
- fTableCache[i].tag = 0;
- fTableCache[i].table = nullptr;
- }
-
- fTableCacheSize = newSize;
- }
-
- fTableCache[fTableCacheCurr].tag = tableTag;
- fTableCache[fTableCacheCurr].table = table;
-
- fTableCacheCurr += 1;
-}
diff --git a/icu4c/source/samples/layout/FontTableCache.h b/icu4c/source/samples/layout/FontTableCache.h
deleted file mode 100644
index e928b91512c..00000000000
--- a/icu4c/source/samples/layout/FontTableCache.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *************************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- **********************************************************************
- * Copyright (C) 2003-2008, International Business Machines
- * Corporation and others. All Rights Reserved.
- **********************************************************************
- */
-
-#ifndef __FONTTABLECACHE_H
-
-#define __FONTTABLECACHE_H
-
-#include "layout/LETypes.h"
-
-struct FontTableCacheEntry;
-
-class FontTableCache
-{
-public:
- FontTableCache();
-
- virtual ~FontTableCache();
-
- const void *find(LETag tableTag) const;
-
-protected:
- virtual const void *readFontTable(LETag tableTag) const = 0;
- virtual void freeFontTable(const void *table) const;
-
-private:
-
- void add(LETag tableTag, const void *table);
-
- FontTableCacheEntry *fTableCache;
- le_int32 fTableCacheCurr;
- le_int32 fTableCacheSize;
-};
-
-#endif
-
diff --git a/icu4c/source/samples/layout/GDIFontInstance.cpp b/icu4c/source/samples/layout/GDIFontInstance.cpp
deleted file mode 100644
index 97d3c6e78d3..00000000000
--- a/icu4c/source/samples/layout/GDIFontInstance.cpp
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2008, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIFontInstance.cpp
- *
- * created on: 08/09/2000
- * created by: Eric R. Mader
- */
-
-#include
-
-#include "layout/LETypes.h"
-#include "layout/LESwaps.h"
-#include "layout/LEFontInstance.h"
-
-#include "GDIFontInstance.h"
-#include "sfnt.h"
-#include "cmaps.h"
-
-GDISurface::GDISurface(HDC theHDC)
- : fHdc(theHDC), fCurrentFont(nullptr)
-{
- // nothing else to do
-}
-
-GDISurface::~GDISurface()
-{
- // nothing to do
-}
-
-void GDISurface::setHDC(HDC theHDC)
-{
- fHdc = theHDC;
- fCurrentFont = nullptr;
-}
-
-void GDISurface::setFont(const GDIFontInstance *font)
-{
-#if 0
- if (fCurrentFont != font) {
- fCurrentFont = font;
- SelectObject(fHdc, font->getFont());
- }
-#else
- SelectObject(fHdc, font->getFont());
-#endif
-}
-
-void GDISurface::drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const float *positions,
- le_int32 x, le_int32 y, le_int32 width, le_int32 height)
-{
- TTGlyphID *ttGlyphs = LE_NEW_ARRAY(TTGlyphID, count);
- le_int32 *dx = LE_NEW_ARRAY(le_int32, count);
- float *ps = LE_NEW_ARRAY(float, count * 2 + 2);
- le_int32 out = 0;
- RECT clip;
-
- clip.top = 0;
- clip.left = 0;
- clip.bottom = height;
- clip.right = width;
-
- for (le_int32 g = 0; g < count; g += 1) {
- TTGlyphID ttGlyph = (TTGlyphID) LE_GET_GLYPH(glyphs[g]);
-
- if (ttGlyph < 0xFFFE) {
- ttGlyphs[out] = ttGlyph;
- dx[out] = (le_int32) (positions[g * 2 + 2] - positions[g * 2]);
- ps[out * 2] = positions[g * 2];
- ps[out * 2 + 1] = positions[g * 2 + 1];
- out += 1;
- }
- }
-
- le_int32 dyStart, dyEnd;
-
- setFont((GDIFontInstance *) font);
-
- dyStart = dyEnd = 0;
-
- while (dyEnd < out) {
- float yOffset = ps[dyStart * 2 + 1];
- float xOffset = ps[dyStart * 2];
-
- while (dyEnd < out && yOffset == ps[dyEnd * 2 + 1]) {
- dyEnd += 1;
- }
-
- ExtTextOut(fHdc, x + (le_int32) xOffset, y + (le_int32) yOffset - font->getAscent(), ETO_CLIPPED | ETO_GLYPH_INDEX, &clip,
- (LPCWSTR) &ttGlyphs[dyStart], dyEnd - dyStart, (INT *) &dx[dyStart]);
-
- dyStart = dyEnd;
- }
-
- LE_DELETE_ARRAY(ps);
- LE_DELETE_ARRAY(dx);
- LE_DELETE_ARRAY(ttGlyphs);
-}
-
-GDIFontInstance::GDIFontInstance(GDISurface *surface, TCHAR *faceName, le_int16 pointSize, LEErrorCode &status)
- : FontTableCache(), fSurface(surface), fFont(nullptr),
- fPointSize(pointSize), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0),
- fDeviceScaleX(1), fDeviceScaleY(1), fMapper(nullptr)
-{
- LOGFONT lf;
- FLOAT dpiX, dpiY;
- POINT pt;
- OUTLINETEXTMETRIC otm;
- HDC hdc = surface->getHDC();
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- SaveDC(hdc);
-
- SetGraphicsMode(hdc, GM_ADVANCED);
- ModifyWorldTransform(hdc, nullptr, MWT_IDENTITY);
- SetViewportOrgEx(hdc, 0, 0, nullptr);
- SetWindowOrgEx(hdc, 0, 0, nullptr);
-
- dpiX = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSX);
- dpiY = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSY);
-
-#if 1
- pt.x = (int) (pointSize * dpiX / 72);
- pt.y = (int) (pointSize * dpiY / 72);
-
- DPtoLP(hdc, &pt, 1);
-#else
- pt.x = pt.y = pointSize;
-#endif
-
- lf.lfHeight = - pt.y;
- lf.lfWidth = 0;
- lf.lfEscapement = 0;
- lf.lfOrientation = 0;
- lf.lfWeight = 0;
- lf.lfItalic = 0;
- lf.lfUnderline = 0;
- lf.lfStrikeOut = 0;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = 0;
- lf.lfClipPrecision = 0;
- lf.lfQuality = 0;
- lf.lfPitchAndFamily = 0;
-
- lstrcpy(lf.lfFaceName, faceName);
-
- fFont = CreateFontIndirect(&lf);
-
- if (fFont == nullptr) {
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- SelectObject(hdc, fFont);
-
- UINT ret = GetOutlineTextMetrics(hdc, sizeof otm, &otm);
-
- if (ret == 0) {
- status = LE_MISSING_FONT_TABLE_ERROR;
- goto restore;
- }
-
- fUnitsPerEM = otm.otmEMSquare;
- fAscent = otm.otmTextMetrics.tmAscent;
- fDescent = otm.otmTextMetrics.tmDescent;
- fLeading = otm.otmTextMetrics.tmExternalLeading;
-
- status = initMapper();
-
- if (LE_FAILURE(status)) {
- goto restore;
- }
-
-#if 0
- status = initFontTableCache();
-#endif
-
-restore:
- RestoreDC(hdc, -1);
-}
-
-GDIFontInstance::GDIFontInstance(GDISurface *surface, const char *faceName, le_int16 pointSize, LEErrorCode &status)
- : FontTableCache(), fSurface(surface), fFont(nullptr),
- fPointSize(pointSize), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0),
- fDeviceScaleX(1), fDeviceScaleY(1), fMapper(nullptr)
-{
- LOGFONTA lf;
- FLOAT dpiX, dpiY;
- POINT pt;
- OUTLINETEXTMETRIC otm;
- HDC hdc = surface->getHDC();
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- SaveDC(hdc);
-
- SetGraphicsMode(hdc, GM_ADVANCED);
- ModifyWorldTransform(hdc, nullptr, MWT_IDENTITY);
- SetViewportOrgEx(hdc, 0, 0, nullptr);
- SetWindowOrgEx(hdc, 0, 0, nullptr);
-
- dpiX = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSX);
- dpiY = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSY);
-
- fDeviceScaleX = dpiX / 72;
- fDeviceScaleY = dpiY / 72;
-
-#if 1
- pt.x = (int) (pointSize * fDeviceScaleX);
- pt.y = (int) (pointSize * fDeviceScaleY);
-
- DPtoLP(hdc, &pt, 1);
-#else
- pt.x = pt.y = pointSize;
-#endif
-
- lf.lfHeight = - pt.y;
- lf.lfWidth = 0;
- lf.lfEscapement = 0;
- lf.lfOrientation = 0;
- lf.lfWeight = 0;
- lf.lfItalic = 0;
- lf.lfUnderline = 0;
- lf.lfStrikeOut = 0;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = 0;
- lf.lfClipPrecision = 0;
- lf.lfQuality = 0;
- lf.lfPitchAndFamily = 0;
-
- strcpy(lf.lfFaceName, faceName);
-
- fFont = CreateFontIndirectA(&lf);
-
- if (fFont == nullptr) {
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- SelectObject(hdc, fFont);
-
- UINT ret = GetOutlineTextMetrics(hdc, sizeof otm, &otm);
-
- if (ret != 0) {
- fUnitsPerEM = otm.otmEMSquare;
- fAscent = otm.otmTextMetrics.tmAscent;
- fDescent = otm.otmTextMetrics.tmDescent;
- fLeading = otm.otmTextMetrics.tmExternalLeading;
- } else {
- const HEADTable *headTable = nullptr;
- const HHEATable *hheaTable = nullptr;
-
- // read unitsPerEm from 'head' table
- headTable = (const HEADTable *) readFontTable(LE_HEAD_TABLE_TAG);
-
- if (headTable == nullptr) {
- status = LE_MISSING_FONT_TABLE_ERROR;
- goto restore;
- }
-
- fUnitsPerEM = SWAPW(headTable->unitsPerEm);
- freeFontTable((const void *)headTable);
-
- hheaTable = (HHEATable *) readFontTable(LE_HHEA_TABLE_TAG);
-
- if (hheaTable == nullptr) {
- status = LE_MISSING_FONT_TABLE_ERROR;
- goto restore;
- }
-
- fAscent = (le_int32) yUnitsToPoints((float) SWAPW(hheaTable->ascent));
- fDescent = (le_int32) yUnitsToPoints((float) SWAPW(hheaTable->descent));
- fLeading = (le_int32) yUnitsToPoints((float) SWAPW(hheaTable->lineGap));
-
- freeFontTable((const void *) hheaTable);
- }
-
- status = initMapper();
-
- if (LE_FAILURE(status)) {
- goto restore;
- }
-
-#if 0
- status = initFontTableCache();
-#endif
-
-restore:
- RestoreDC(hdc, -1);
-}
-
-GDIFontInstance::~GDIFontInstance()
-{
-#if 0
- flushFontTableCache();
- delete[] fTableCache;
-#endif
-
- if (fFont != nullptr) {
- // FIXME: call RemoveObject first?
- DeleteObject(fFont);
- }
-
- delete fMapper;
- fMapper = nullptr;
-}
-
-LEErrorCode GDIFontInstance::initMapper()
-{
- LETag cmapTag = LE_CMAP_TABLE_TAG;
- const CMAPTable *cmap = (const CMAPTable *) readFontTable(cmapTag);
-
- if (cmap == nullptr) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- fMapper = CMAPMapper::createUnicodeMapper(cmap);
-
- if (fMapper == nullptr) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- return LE_NO_ERROR;
-}
-
-const void *GDIFontInstance::getFontTable(LETag tableTag) const
-{
- return FontTableCache::find(tableTag);
-}
-
-const void *GDIFontInstance::readFontTable(LETag tableTag) const
-{
- fSurface->setFont(this);
-
- HDC hdc = fSurface->getHDC();
- DWORD stag = SWAPL(tableTag);
- DWORD len = GetFontData(hdc, stag, 0, nullptr, 0);
- void *result = nullptr;
-
- if (len != GDI_ERROR) {
- result = LE_NEW_ARRAY(char, len);
- GetFontData(hdc, stag, 0, result, len);
- }
-
- return result;
-}
-
-void GDIFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
-{
- advance.fX = 0;
- advance.fY = 0;
-
- if (glyph == 0xFFFE || glyph == 0xFFFF) {
- return;
- }
-
-
- GLYPHMETRICS metrics;
- DWORD result;
- MAT2 identity = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
- HDC hdc = fSurface->getHDC();
-
- fSurface->setFont(this);
-
- result = GetGlyphOutline(hdc, glyph, GGO_GLYPH_INDEX | GGO_METRICS, &metrics, 0, nullptr, &identity);
-
- if (result == GDI_ERROR) {
- return;
- }
-
- advance.fX = metrics.gmCellIncX;
- return;
-}
-
-le_bool GDIFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
-{
-#if 0
- hsFixedPoint2 pt;
- le_bool result;
-
- result = fFontInstance->getGlyphPoint(glyph, pointNumber, pt);
-
- if (result) {
- point.fX = xUnitsToPoints(pt.fX);
- point.fY = yUnitsToPoints(pt.fY);
- }
-
- return result;
-#else
- return false;
-#endif
-}
-
diff --git a/icu4c/source/samples/layout/GDIFontInstance.h b/icu4c/source/samples/layout/GDIFontInstance.h
deleted file mode 100644
index e0ab1e0e4a3..00000000000
--- a/icu4c/source/samples/layout/GDIFontInstance.h
+++ /dev/null
@@ -1,162 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIFontInstance.h
- *
- * created on: 08/09/2000
- * created by: Eric R. Mader
- */
-
-#ifndef __GDIFONTINSTANCE_H
-#define __GDIFONTINSTANCE_H
-
-#include
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-#include "RenderingSurface.h"
-#include "FontTableCache.h"
-#include "cmaps.h"
-
-class GDIFontInstance;
-
-class GDISurface : public RenderingSurface
-{
-public:
- GDISurface(HDC theHDC);
- virtual ~GDISurface();
-
- virtual void drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-
- void setFont(const GDIFontInstance *font);
- HDC getHDC() const;
- void setHDC(HDC theHDC);
-
-private:
- HDC fHdc;
- const GDIFontInstance *fCurrentFont;
-};
-
-inline HDC GDISurface::getHDC() const
-{
- return fHdc;
-}
-
-class GDIFontInstance : public LEFontInstance, protected FontTableCache
-{
-protected:
- GDISurface *fSurface;
- HFONT fFont;
-
- le_int32 fPointSize;
- le_int32 fUnitsPerEM;
- le_int32 fAscent;
- le_int32 fDescent;
- le_int32 fLeading;
-
- float fDeviceScaleX;
- float fDeviceScaleY;
-
- CMAPMapper *fMapper;
-
- virtual const void *readFontTable(LETag tableTag) const;
-
- virtual LEErrorCode initMapper();
-
-public:
- GDIFontInstance(GDISurface *surface, TCHAR *faceName, le_int16 pointSize, LEErrorCode &status);
- GDIFontInstance(GDISurface *surface, const char *faceName, le_int16 pointSize, LEErrorCode &status);
- //GDIFontInstance(GDISurface *surface, le_int16 pointSize);
-
- virtual ~GDIFontInstance();
-
- HFONT getFont() const;
-
- virtual const void *getFontTable(LETag tableTag) const;
-
- virtual le_int32 getUnitsPerEM() const;
-
- virtual le_int32 getAscent() const;
-
- virtual le_int32 getDescent() const;
-
- virtual le_int32 getLeading() const;
-
- virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
-
- virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
-
- virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
-
- float getXPixelsPerEm() const;
-
- float getYPixelsPerEm() const;
-
- float getScaleFactorX() const;
-
- float getScaleFactorY() const;
-};
-
-inline HFONT GDIFontInstance::getFont() const
-{
- return fFont;
-}
-
-inline le_int32 GDIFontInstance::getUnitsPerEM() const
-{
- return fUnitsPerEM;
-}
-
-inline le_int32 GDIFontInstance::getAscent() const
-{
- return fAscent;
-}
-
-inline le_int32 GDIFontInstance::getDescent() const
-{
- return fDescent;
-}
-
-inline le_int32 GDIFontInstance::getLeading() const
-{
- return fLeading;
-}
-
-inline LEGlyphID GDIFontInstance::mapCharToGlyph(LEUnicode32 ch) const
-{
- return fMapper->unicodeToGlyph(ch);
-}
-
-inline float GDIFontInstance::getXPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GDIFontInstance::getYPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GDIFontInstance::getScaleFactorX() const
-{
- return fDeviceScaleX;
-}
-
-inline float GDIFontInstance::getScaleFactorY() const
-{
- return fDeviceScaleY;
-}
-
-#endif
diff --git a/icu4c/source/samples/layout/GDIFontMap.cpp b/icu4c/source/samples/layout/GDIFontMap.cpp
deleted file mode 100644
index 3ecc9a66219..00000000000
--- a/icu4c/source/samples/layout/GDIFontMap.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include
-
-#include "layout/LEFontInstance.h"
-
-#include "GDIFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-#include "GDIFontMap.h"
-
-GDIFontMap::GDIFontMap(GDISurface *surface, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
- : FontMap(fileName, pointSize, guiSupport, status), fSurface(surface)
-{
- // nothing to do?
-}
-
-GDIFontMap::~GDIFontMap()
-{
- // anything?
-}
-
-const LEFontInstance *GDIFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
-{
- LEFontInstance *result = new GDIFontInstance(fSurface, fontName, pointSize, status);
-
- if (LE_FAILURE(status)) {
- delete result;
- result = nullptr;
- }
-
- return result;
-}
diff --git a/icu4c/source/samples/layout/GDIFontMap.h b/icu4c/source/samples/layout/GDIFontMap.h
deleted file mode 100644
index 2c07c230c11..00000000000
--- a/icu4c/source/samples/layout/GDIFontMap.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2003, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __GDIFONTMAP_H
-#define __GDIFONTMAP_H
-
-#include
-
-#include "unicode/uscript.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "FontMap.h"
-#include "GUISupport.h"
-#include "GDIFontInstance.h"
-
-#define BUFFER_SIZE 128
-
-class GDIFontMap : public FontMap
-{
-public:
- GDIFontMap(GDISurface *surface, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
-
- virtual ~GDIFontMap();
-
-protected:
- virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status);
-
-private:
- GDISurface *fSurface;
-};
-
-#endif
diff --git a/icu4c/source/samples/layout/GDIGUISupport.cpp b/icu4c/source/samples/layout/GDIGUISupport.cpp
deleted file mode 100644
index a0ad3846628..00000000000
--- a/icu4c/source/samples/layout/GDIGUISupport.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2001, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIGUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#include
-
-#include "GDIGUISupport.h"
-
-void GDIGUISupport::postErrorMessage(const char *message, const char *title)
-{
- MessageBoxA(nullptr, message, title, MB_ICONERROR);
-}
-
diff --git a/icu4c/source/samples/layout/GDIGUISupport.h b/icu4c/source/samples/layout/GDIGUISupport.h
deleted file mode 100644
index c77d40bafa8..00000000000
--- a/icu4c/source/samples/layout/GDIGUISupport.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GDIGUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GDIGUISUPPORT_H
-#define __GDIGUISUPPORT_H
-
-#include "GUISupport.h"
-
-class GDIGUISupport : public GUISupport
-{
-public:
- GDIGUISupport() {};
- virtual ~GDIGUISupport() {};
-
- virtual void postErrorMessage(const char *message, const char *title);
-};
-
-#endif
diff --git a/icu4c/source/samples/layout/GUISupport.h b/icu4c/source/samples/layout/GUISupport.h
deleted file mode 100644
index a88bf5f8761..00000000000
--- a/icu4c/source/samples/layout/GUISupport.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GUISUPPORT_H
-#define __GUISUPPORT_H
-
-class GUISupport
-{
-public:
- GUISupport() {};
- virtual ~GUISupport() {};
-
- virtual void postErrorMessage(const char *message, const char *title) = 0;
-};
-
-#endif
diff --git a/icu4c/source/samples/layout/GnomeFontInstance.cpp b/icu4c/source/samples/layout/GnomeFontInstance.cpp
deleted file mode 100644
index 5e8fe12b023..00000000000
--- a/icu4c/source/samples/layout/GnomeFontInstance.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeFontInstance.cpp
- *
- * created on: 08/30/2001
- * created by: Eric R. Mader
- */
-
-#include
-#include
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-#include FT_RENDER_H
-#include FT_TRUETYPE_TABLES_H
-#include
-#include
-
-#include "layout/LETypes.h"
-#include "layout/LESwaps.h"
-
-#include "GnomeFontInstance.h"
-#include "sfnt.h"
-#include "cmaps.h"
-
-using icu::LEFontInstance;
-
-GnomeSurface::GnomeSurface(GtkWidget *theWidget)
- : fWidget(theWidget)
-{
- fCairo = gdk_cairo_create(fWidget->window);
-}
-
-GnomeSurface::~GnomeSurface()
-{
- cairo_destroy(fCairo);
-}
-
-void GnomeSurface::drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 /*width*/, le_int32 /*height*/)
-{
- GnomeFontInstance *gFont = (GnomeFontInstance *) font;
-
- gFont->rasterizeGlyphs(fCairo, glyphs, count, positions, x, y);
-}
-
-GnomeFontInstance::GnomeFontInstance(FT_Library engine, const char *fontPathName, le_int16 pointSize, LEErrorCode &status)
- : FontTableCache(), fPointSize(pointSize), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0),
- fDeviceScaleX(1), fDeviceScaleY(1), fMapper(nullptr)
-{
- FT_Error error;
-
- fFace = nullptr;
- fCairoFace = nullptr;
-
- error = FT_New_Face(engine, fontPathName, 0, &fFace);
-
- if (error != 0) {
- printf("OOPS! Got error code %d\n", error);
- status = LE_FONT_FILE_NOT_FOUND_ERROR;
- return;
- }
-
- // FIXME: what about the display resolution?
- fDeviceScaleX = ((float) 96) / 72;
- fDeviceScaleY = ((float) 96) / 72;
-
- error = FT_Set_Char_Size(fFace, 0, pointSize << 6, 92, 92);
-
- fCairoFace = cairo_ft_font_face_create_for_ft_face(fFace, 0);
-
- fUnitsPerEM = fFace->units_per_EM;
-
- fAscent = (le_int32) (yUnitsToPoints(fFace->ascender) * fDeviceScaleY);
- fDescent = (le_int32) -(yUnitsToPoints(fFace->descender) * fDeviceScaleY);
- fLeading = (le_int32) (yUnitsToPoints(fFace->height) * fDeviceScaleY) - fAscent - fDescent;
-
- // printf("Face = %s, unitsPerEM = %d, ascent = %d, descent = %d\n", fontPathName, fUnitsPerEM, fAscent, fDescent);
-
- if (error != 0) {
- status = LE_MEMORY_ALLOCATION_ERROR;
- return;
- }
-
- status = initMapper();
-}
-
-GnomeFontInstance::~GnomeFontInstance()
-{
- cairo_font_face_destroy(fCairoFace);
-
- if (fFace != nullptr) {
- FT_Done_Face(fFace);
- }
-}
-
-LEErrorCode GnomeFontInstance::initMapper()
-{
- LETag cmapTag = LE_CMAP_TABLE_TAG;
- const CMAPTable *cmap = (const CMAPTable *) readFontTable(cmapTag);
-
- if (cmap == nullptr) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- fMapper = CMAPMapper::createUnicodeMapper(cmap);
-
- if (fMapper == nullptr) {
- return LE_MISSING_FONT_TABLE_ERROR;
- }
-
- return LE_NO_ERROR;
-}
-
-const void *GnomeFontInstance::getFontTable(LETag tableTag) const
-{
- return FontTableCache::find(tableTag);
-}
-
-const void *GnomeFontInstance::readFontTable(LETag tableTag) const
-{
- FT_ULong len = 0;
- FT_Byte *result = nullptr;
-
- FT_Load_Sfnt_Table(fFace, tableTag, 0, nullptr, &len);
-
- if (len > 0) {
- result = LE_NEW_ARRAY(FT_Byte, len);
- FT_Load_Sfnt_Table(fFace, tableTag, 0, result, &len);
- }
-
- return result;
-}
-
-void GnomeFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
-{
- advance.fX = 0;
- advance.fY = 0;
-
- if (glyph >= 0xFFFE) {
- return;
- }
-
- FT_Error error;
-
- error = FT_Load_Glyph(fFace, glyph, FT_LOAD_DEFAULT);
-
- if (error != 0) {
- return;
- }
-
- advance.fX = fFace->glyph->metrics.horiAdvance >> 6;
-}
-
-le_bool GnomeFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
-{
- FT_Error error;
-
- error = FT_Load_Glyph(fFace, glyph, FT_LOAD_DEFAULT);
-
- if (error != 0) {
- return false;
- }
-
- if (pointNumber >= fFace->glyph->outline.n_points) {
- return false;
- }
-
- point.fX = fFace->glyph->outline.points[pointNumber].x >> 6;
- point.fY = fFace->glyph->outline.points[pointNumber].y >> 6;
-
- return true;
-}
-
-void GnomeFontInstance::rasterizeGlyphs(cairo_t *cairo, const LEGlyphID *glyphs, le_int32 glyphCount, const float *positions,
- le_int32 x, le_int32 y) const
-{
- cairo_glyph_t *glyph_t = LE_NEW_ARRAY(cairo_glyph_t, glyphCount);
- le_int32 in, out;
-
- for (in = 0, out = 0; in < glyphCount; in += 1) {
- TTGlyphID glyph = LE_GET_GLYPH(glyphs[in]);
-
- if (glyph < 0xFFFE) {
- glyph_t[out].index = glyph;
- glyph_t[out].x = x + positions[in*2];
- glyph_t[out].y = y + positions[in*2 + 1];
-
- out += 1;
- }
- }
-
- cairo_set_font_face(cairo, fCairoFace);
- cairo_set_font_size(cairo, getXPixelsPerEm() * getScaleFactorX());
- cairo_show_glyphs(cairo, glyph_t, out);
-
- LE_DELETE_ARRAY(glyph_t);
-}
diff --git a/icu4c/source/samples/layout/GnomeFontInstance.h b/icu4c/source/samples/layout/GnomeFontInstance.h
deleted file mode 100644
index 9045eb61559..00000000000
--- a/icu4c/source/samples/layout/GnomeFontInstance.h
+++ /dev/null
@@ -1,174 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2006, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeFontInstance.h
- *
- * created on: 08/30/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GNOMEFONTINSTANCE_H
-#define __GNOMEFONTINSTANCE_H
-
-#include
-#include
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-#include
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "RenderingSurface.h"
-#include "FontTableCache.h"
-#include "cmaps.h"
-
-using icu::LEFontInstance;
-
-class GnomeSurface : public RenderingSurface
-{
-public:
- GnomeSurface(GtkWidget *theWidget);
- virtual ~GnomeSurface();
-
- virtual void drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-
- GtkWidget *getWidget() const;
- void setWidget(GtkWidget *theWidget);
-
-private:
- GtkWidget *fWidget;
- cairo_t *fCairo;
-};
-
-class GnomeFontInstance : public LEFontInstance, protected FontTableCache
-{
- protected:
- FT_Face fFace;
-// FT_Glyph fGlyph;
-
- cairo_font_face_t *fCairoFace;
-
- le_int32 fPointSize;
- le_int32 fUnitsPerEM;
- le_int32 fAscent;
- le_int32 fDescent;
- le_int32 fLeading;
-
- float fDeviceScaleX;
- float fDeviceScaleY;
-
- CMAPMapper *fMapper;
-
- virtual const void *readFontTable(LETag tableTag) const;
-
- virtual LEErrorCode initMapper();
-
- public:
- GnomeFontInstance(FT_Library engine, const char *fontPathName, le_int16 pointSize, LEErrorCode &status);
-
- virtual ~GnomeFontInstance();
-
- virtual const void *getFontTable(LETag tableTag) const;
-
- virtual le_int32 getUnitsPerEM() const;
-
- virtual le_int32 getAscent() const;
-
- virtual le_int32 getDescent() const;
-
- virtual le_int32 getLeading() const;
-
- virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
-
- virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
-
- virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
-
- float getXPixelsPerEm() const;
-
- float getYPixelsPerEm() const;
-
- float getScaleFactorX() const;
-
- float getScaleFactorY() const;
-
- void rasterizeGlyphs(cairo_t *cairo, const LEGlyphID *glyphs, le_int32 glyphCount, const float *positions,
- le_int32 x, le_int32 y) const;
-};
-
-inline GtkWidget *GnomeSurface::getWidget() const
-{
- return fWidget;
-}
-
-inline void GnomeSurface::setWidget(GtkWidget *theWidget)
-{
- fWidget = theWidget;
-}
-
-/*
-inline FT_Instance GnomeFontInstance::getFont() const
-{
- return fInstance;
-}
-*/
-
-inline le_int32 GnomeFontInstance::getUnitsPerEM() const
-{
- return fUnitsPerEM;
-}
-
-inline le_int32 GnomeFontInstance::getAscent() const
-{
- return fAscent;
-}
-
-inline le_int32 GnomeFontInstance::getDescent() const
-{
- return fDescent;
-}
-
-inline le_int32 GnomeFontInstance::getLeading() const
-{
- return fLeading;
-}
-
-inline LEGlyphID GnomeFontInstance::mapCharToGlyph(LEUnicode32 ch) const
-{
- return fMapper->unicodeToGlyph(ch);
-}
-
-inline float GnomeFontInstance::getXPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GnomeFontInstance::getYPixelsPerEm() const
-{
- return (float) fPointSize;
-}
-
-inline float GnomeFontInstance::getScaleFactorX() const
-{
- return fDeviceScaleX;
-}
-
-inline float GnomeFontInstance::getScaleFactorY() const
-{
- return fDeviceScaleY;
-}
-
-#endif
diff --git a/icu4c/source/samples/layout/GnomeFontMap.cpp b/icu4c/source/samples/layout/GnomeFontMap.cpp
deleted file mode 100644
index c2716051d4b..00000000000
--- a/icu4c/source/samples/layout/GnomeFontMap.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2006, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include
-
-#include
-#include FT_FREETYPE_H
-
-#include "layout/LEFontInstance.h"
-#include "GnomeFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-#include "GnomeFontMap.h"
-
-using icu::LEFontInstance;
-
-GnomeFontMap::GnomeFontMap(FT_Library engine, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status)
- : FontMap(fileName, pointSize, guiSupport, status), fEngine(engine)
-{
- // nothing to do?
-}
-
-GnomeFontMap::~GnomeFontMap()
-{
- // anything?
-}
-
-const LEFontInstance *GnomeFontMap::openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status)
-{
- LEFontInstance *result = new GnomeFontInstance(fEngine, fontName, pointSize, status);
-
- if (LE_FAILURE(status)) {
- delete result;
- result = nullptr;
- }
-
- return result;
-}
diff --git a/icu4c/source/samples/layout/GnomeFontMap.h b/icu4c/source/samples/layout/GnomeFontMap.h
deleted file mode 100644
index 8163d40ce0e..00000000000
--- a/icu4c/source/samples/layout/GnomeFontMap.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2006, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __GNOMEFONTMAP_H
-#define __GNOMEFONTMAP_H
-
-#include
-#include FT_FREETYPE_H
-
-#include "unicode/uscript.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "GUISupport.h"
-#include "FontMap.h"
-
-using icu::LEFontInstance;
-
-#define BUFFER_SIZE 128
-
-class GnomeFontMap : public FontMap
-{
- public:
- GnomeFontMap(FT_Library engine, const char *fileName, le_int16 pointSize, GUISupport *guiSupport, LEErrorCode &status);
-
- virtual ~GnomeFontMap();
-
- protected:
- virtual const LEFontInstance *openFont(const char *fontName, le_int16 pointSize, LEErrorCode &status);
-
- private:
- FT_Library fEngine;
-};
-
-#endif
diff --git a/icu4c/source/samples/layout/GnomeGUISupport.cpp b/icu4c/source/samples/layout/GnomeGUISupport.cpp
deleted file mode 100644
index e008d05c926..00000000000
--- a/icu4c/source/samples/layout/GnomeGUISupport.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2001, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeGUISupport.cpp
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#if 1
-#include
-#else
-#include
-#endif
-
-#include "GnomeGUISupport.h"
-
-void GnomeGUISupport::postErrorMessage(const char *message, const char *title)
-{
-#if 1
- gchar *s;
- GtkWidget *error;
-
- s = g_strconcat(title, ":\n", message, nullptr);
- error = gnome_error_dialog(s);
- gtk_widget_show(error);
- g_free(s);
-#else
- fprintf(stderr, "%s: %s\n", title, message);
-#endif
-}
-
-
diff --git a/icu4c/source/samples/layout/GnomeGUISupport.h b/icu4c/source/samples/layout/GnomeGUISupport.h
deleted file mode 100644
index b11f5be69cb..00000000000
--- a/icu4c/source/samples/layout/GnomeGUISupport.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2005, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: GnomeGUISupport.h
- *
- * created on: 11/06/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __GNOMEGUISUPPORT_H
-#define __GNOMEGUISUPPORT_H
-
-#include "GUISupport.h"
-
-class GnomeGUISupport : public GUISupport
-{
-public:
- GnomeGUISupport() {};
- virtual ~GnomeGUISupport() {};
-
- virtual void postErrorMessage(const char *message, const char *title);
-};
-
-#endif
diff --git a/icu4c/source/samples/layout/LayoutSample.rc b/icu4c/source/samples/layout/LayoutSample.rc
deleted file mode 100644
index 9b4447134cc..00000000000
--- a/icu4c/source/samples/layout/LayoutSample.rc
+++ /dev/null
@@ -1,123 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
-// License & terms of use: http://www.unicode.org/copyright.html
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-/*
-*******************************************************************************
-*
-* Copyright (C) 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2002-2003, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-*/
-#include
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-LAYOUTSAMPLE MENU DISCARDABLE
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&New Sample\tCtrl+N", IDM_FILE_NEWSAMPLE
- MENUITEM "&Open...\tCtrl+O", IDM_FILE_OPEN
- MENUITEM SEPARATOR
- MENUITEM "&Close\tCtrl+W", IDM_FILE_CLOSE
- MENUITEM "E&xit\tCtrl+Q", IDM_FILE_EXIT
- END
- POPUP "&Help"
- BEGIN
- MENUITEM "&About Layout Sample...", IDM_HELP_ABOUTLAYOUTSAMPLE
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-LAYOUTSAMPLE ACCELERATORS DISCARDABLE
-BEGIN
- "N", IDM_FILE_NEWSAMPLE, VIRTKEY, CONTROL, NOINVERT
- "O", IDM_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
- "Q", IDM_FILE_EXIT, VIRTKEY, CONTROL, NOINVERT
- "W", IDM_FILE_CLOSE, VIRTKEY, CONTROL, NOINVERT
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "/*\r\n"
- "*******************************************************************************\r\n"
- "*\r\n"
- "* Copyright (C) 2002-2003, International Business Machines\r\n"
- "* Corporation and others. All Rights Reserved.\r\n"
- "*\r\n"
- "*******************************************************************************\r\n"
- "*/\r\n"
- "#include \r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/icu4c/source/samples/layout/Makefile.in b/icu4c/source/samples/layout/Makefile.in
deleted file mode 100644
index 6f3be57655c..00000000000
--- a/icu4c/source/samples/layout/Makefile.in
+++ /dev/null
@@ -1,110 +0,0 @@
-## Copyright (C) 2016 and later: Unicode, Inc. and others.
-## License & terms of use: http://www.unicode.org/copyright.html
-##
-## Makefile.in for ICU - samples/layout
-## Copyright (c) 2001-2011, International Business Machines Corporation and
-## others. All Rights Reserved.
-
-## Source directory information
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-
-top_builddir = ../..
-
-include $(top_builddir)/icudefs.mk
-
-## Platform-specific setup
-include @platform_make_fragment@
-
-## Build directory information
-subdir = samples/layout
-
-## Extra files to remove for 'make clean'
-CLEANFILES = *~ $(DEPS)
-
-## Target information
-TARGET = gnomelayout
-CTARGET = cgnomelayout
-
-CPPFLAGS += -DLE_USE_CMEMORY `pkg-config --cflags libgnomeui-2.0 freetype2 cairo` -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/layoutex -I$(top_srcdir) -g
-
-LIBS = $(LIBICULX) $(LIBICULE) $(LIBICUUC) $(LIBICUI18N) @LIBS@ @LIB_M@ `pkg-config --libs libgnomeui-2.0 freetype2 cairo`
-
-COMMON=cmaps.o UnicodeReader.o GnomeGUISupport.o FontMap.o GnomeFontMap.o ScriptCompositeFontInstance.o GnomeFontInstance.o FontTableCache.o paragraph.o
-
-OBJECTS=gnomelayout.o
-
-COBJECTS=gnomeglue.o pflow.o rsurface.o ucreader.o cgnomelayout.o
-
-DEPS = $(OBJECTS:.o=.d)
-
-## List of phony targets
-.PHONY : all all-local install install-local clean clean-local \
-distclean distclean-local dist dist-local check check-local
-
-## Clear suffix list
-.SUFFIXES :
-
-## List of standard targets
-all: all-local
-install: install-local
-clean: clean-local
-distclean : distclean-local
-dist: dist-local
-check: all check-local
-c-all: c-all-local
-c-check: c-all c-check-local
-
-all-local: $(TARGET)
-
-c-all-local: $(CTARGET)
-
-install-local:
-
-dist-local:
-
-clean-local:
- test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
- $(RMV) $(COMMON) $(OBJECTS) $(COBJECTS) $(TARGET)
-
-distclean-local: clean-local
- $(RMV) Makefile
-
-check-local: all-local
- $(INVOKE) ./$(TARGET)
-
-c-check-local: c-all-local
- $(INVOKE) ./$(CTARGET)
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-# The following two rules make it possible to
-# compile scrptrun.cpp from the extra/scrptrun directory.
-# they were copied from the default rules in mh-linux which
-# is probably OK because this sample will only run on Linux...
-scrptrun.d: $(top_srcdir)/extra/scrptrun/scrptrun.cpp
- $(SHELL) -ec '$(GEN_DEPS.cc) $< \
- | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
- [ -s $@ ] || rm -f $@'
-
-scrptrun.o: $(top_srcdir)/extra/scrptrun/scrptrun.cpp
- $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
-
-$(TARGET) : $(COMMON) $(OBJECTS)
- $(LINK.cc) -o $@ $^ $(LIBS)
-
-$(CTARGET) : $(COMMON) $(COBJECTS)
- $(LINK.cc) -o $@ $^ $(LIBS)
-
-invoke:
- ICU_DATA=$${ICU_DATA:-$(top_builddir)/data/} TZ=PST8PDT $(INVOKE) $(INVOCATION)
-
-ifeq (,$(MAKECMDGOALS))
--include $(DEPS)
-else
-ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
--include $(DEPS)
-endif
-endif
diff --git a/icu4c/source/samples/layout/RenderingSurface.h b/icu4c/source/samples/layout/RenderingSurface.h
deleted file mode 100644
index 2d4a8df4d17..00000000000
--- a/icu4c/source/samples/layout/RenderingSurface.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: RenderingFontInstance.h
- *
- * created on: 02/20/2003
- * created by: Eric R. Mader
- */
-
-#ifndef __RENDERINGSURFACE_H
-#define __RENDERINGSURFACE_H
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-using icu::LEFontInstance;
-
-class RenderingSurface
-{
-public:
- RenderingSurface() {};
- virtual ~RenderingSurface() {};
-
- virtual void drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height) = 0;
-};
-
-#endif
diff --git a/icu4c/source/samples/layout/Sample.txt b/icu4c/source/samples/layout/Sample.txt
deleted file mode 100644
index 367821b7933..00000000000
--- a/icu4c/source/samples/layout/Sample.txt
+++ /dev/null
@@ -1 +0,0 @@
-п»їThe LayoutEngine does all the work necessary to display Unicode text written in languages with complex writing systems such as Hindi (हिन्दी) Thai (ไทย) and Arabic (Ш§Щ„Ш№Ш±ШЁЩЉШ©). Here's a sample of some text written in Sanskrit: श्रीमद् а¤а¤—वद्गीता अध्याय अर्जुन विषाद योग धृतराष्ट्र उवाच। धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः मामकाः पाण्डवाश्चैव किमकुर्वत संजय Here's a sample of some text written in Arabic: ШЈШіШ§ШіЩ‹Ш§ШЊ ШЄШЄШ№Ш§Щ…Щ„ Ш§Щ„ШЩ€Ш§ШіЩЉШЁ ЩЃЩ‚Ш· Щ…Ш№ Ш§Щ„ШЈШ±Щ‚Ш§Щ…ШЊ Щ€ШЄЩ‚Щ€Щ… ШЁШЄШ®ШІЩЉЩ† Ш§Щ„ШЈШШ±ЩЃ Щ€Ш§Щ„Щ…ШШ§Ш±ЩЃ Ш§Щ„ШЈШ®Ш±Щ‰ ШЁШ№ШЇ ШЈЩ† ШЄЩЏШ№Ш·ЩЉ Ш±Щ‚Щ…Ш§ Щ…Ш№ЩЉЩ†Ш§ Щ„ЩѓЩ„ Щ€Ш§ШШЇ Щ…Щ†Щ‡Ш§. Щ€Щ‚ШЁЩ„ Ш§Ш®ШЄШ±Ш§Ш№ "ЩЉЩ€Щ†ЩђЩѓЩ€ШЇ"ШЊ ЩѓШ§Щ† Щ‡Щ†Ш§Щѓ Щ…Ш¦Ш§ШЄ Ш§Щ„ШЈЩ†ШёЩ…Ш© Щ„Щ„ШЄШґЩЃЩЉШ± Щ€ШЄШ®ШµЩЉШµ Щ‡Ш°Щ‡ Ш§Щ„ШЈШ±Щ‚Ш§Щ… Щ„Щ„Щ…ШШ§Ш±ЩЃШЊ Щ€Щ„Щ… ЩЉЩ€Ш¬ШЇ Щ†ШёШ§Щ… ШЄШґЩЃЩЉШ± Щ€Ш§ШШЇ ЩЉШШЄЩ€ЩЉ Ш№Щ„Щ‰ Ш¬Щ…ЩЉШ№ Ш§Щ„Щ…ШШ§Ш±ЩЃ Ш§Щ„Ш¶Ш±Щ€Ш±ЩЉШ© and here's a sample of some text written in Thai: บทที่๑พายุไซโคลนโดโรаёаёµаёаёІаёЁаё±аёўаёаёўаё№а№€аё—่ามกลางทุ่งใหญ่ในแคนซัสกับลุงเฮนรีชาวไร่และป้าเаёа№‡аёЎаё รรยาชาวไร่บ้านขаёаё‡аёћаё§аёЃа№Ђаё‚าหลังเล็กเพราะไม้สร้างบ้านต้аёаё‡аё‚นมาด้วยเกวียนเป็นระยะทางหลายไมล์
diff --git a/icu4c/source/samples/layout/ScriptCompositeFontInstance.cpp b/icu4c/source/samples/layout/ScriptCompositeFontInstance.cpp
deleted file mode 100644
index 651466f4236..00000000000
--- a/icu4c/source/samples/layout/ScriptCompositeFontInstance.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: ScriptCompositeFontInstance.cpp
- *
- * created on: 02/05/2003
- * created by: Eric R. Mader
- */
-
-#include "layout/LETypes.h"
-
-#include "unicode/uscript.h"
-
-#include "FontMap.h"
-
-#include "ScriptCompositeFontInstance.h"
-
-using icu::LEFontInstance;
-using icu::scriptCodeCount;
-
-const char ScriptCompositeFontInstance::fgClassID=0;
-
-ScriptCompositeFontInstance::ScriptCompositeFontInstance(FontMap *fontMap)
- : fFontMap(fontMap)
-{
- // nothing else to do
-}
-
-ScriptCompositeFontInstance::~ScriptCompositeFontInstance()
-{
- delete fFontMap;
- fFontMap = nullptr;
-}
-
-void ScriptCompositeFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 script = LE_GET_SUB_FONT(glyph);
- const LEFontInstance *font = fFontMap->getScriptFont(script, status);
-
- advance.fX = 0;
- advance.fY = 0;
-
- if (LE_SUCCESS(status)) {
- font->getGlyphAdvance(LE_GET_GLYPH(glyph), advance);
- }
-}
-
-le_bool ScriptCompositeFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 script = LE_GET_SUB_FONT(glyph);
- const LEFontInstance *font = fFontMap->getScriptFont(script, status);
-
- if (LE_SUCCESS(status)) {
- return font->getGlyphPoint(LE_GET_GLYPH(glyph), pointNumber, point);
- }
-
- return false;
-}
-
-const LEFontInstance *ScriptCompositeFontInstance::getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const
-{
- if (LE_FAILURE(success)) {
- return nullptr;
- }
-
- if (chars == nullptr || *offset < 0 || limit < 0 || *offset >= limit || script < 0 || script >= scriptCodeCount) {
- success = LE_ILLEGAL_ARGUMENT_ERROR;
- return nullptr;
- }
-
- const LEFontInstance *result = fFontMap->getScriptFont(script, success);
-
- if (LE_FAILURE(success)) {
- return nullptr;
- }
-
- *offset = limit;
- return result;
-}
-
-// This is the really stupid version that doesn't look in any other font for the character...
-// It would be better to also look in the "DEFAULT:" font. Another thing to do would be to
-// look in all the fonts in some order, script code order being the most obvious...
-LEGlyphID ScriptCompositeFontInstance::mapCharToGlyph(LEUnicode32 ch) const
-{
- UErrorCode error = U_ZERO_ERROR;
- LEErrorCode status = LE_NO_ERROR;
- le_int32 script = uscript_getScript(ch, &error);
- const LEFontInstance *scriptFont = fFontMap->getScriptFont(script, status);
- LEGlyphID subFont = LE_SET_SUB_FONT(0, script);
-
- if (LE_FAILURE(status)) {
- return subFont;
- }
-
- LEGlyphID glyph = scriptFont->mapCharToGlyph(ch);
-
- return LE_SET_GLYPH(subFont, glyph);
-}
-
diff --git a/icu4c/source/samples/layout/ScriptCompositeFontInstance.h b/icu4c/source/samples/layout/ScriptCompositeFontInstance.h
deleted file mode 100644
index 756edfb8aa4..00000000000
--- a/icu4c/source/samples/layout/ScriptCompositeFontInstance.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * %W% %E%
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
- *
- */
-
-#ifndef __SCRIPTCOMPOSITEFONTINSTANCE_H
-#define __SCRIPTCOMPOSITEFONTINSTANCE_H
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-
-#include "FontMap.h"
-
-using icu::LEFontInstance;
-
-// U_NAMESPACE_BEGIN
-
-class ScriptCompositeFontInstance : public LEFontInstance
-{
-public:
-
- ScriptCompositeFontInstance(FontMap *fontMap);
-
- virtual ~ScriptCompositeFontInstance();
-
- /**
- * Get a physical font which can render the given text. For composite fonts,
- * if there is no single physical font which can render all of the text,
- * return a physical font which can render an initial substring of the text,
- * and set the offset
parameter to the end of that substring.
- *
- * Internally, the LayoutEngine works with runs of text all in the same
- * font and script, so it is best to call this method with text which is
- * in a single script, passing the script code in as a hint. If you don't
- * know the script of the text, you can use zero, which is the script code
- * for characters used in more than one script.
- *
- * The default implementation of this method is intended for instances of
- * LEFontInstance
which represent a physical font. It returns
- * this
and indicates that the entire string can be rendered.
- *
- * This method will return a valid LEFontInstance
unless you
- * have passed illegal parameters, or an internal error has been encountered.
- * For composite fonts, it may return the warning LE_NO_SUBFONT_WARNING
- * to indicate that the returned font may not be able to render all of
- * the text. Whenever a valid font is returned, the offset
parameter
- * will be advanced by at least one.
- *
- * Subclasses which implement composite fonts must override this method.
- * Where it makes sense, they should use the script code as a hint to render
- * characters from the COMMON script in the font which is used for the given
- * script. For example, if the input text is a series of Arabic words separated
- * by spaces, and the script code passed in is arabScriptCode
you
- * should return the font used for Arabic characters for all of the input text,
- * including the spaces. If, on the other hand, the input text contains characters
- * which cannot be rendered by the font used for Arabic characters, but which can
- * be rendered by another font, you should return that font for those characters.
- *
- * @param chars - the array of Unicode characters.
- * @param offset - a pointer to the starting offset in the text. On exit this
- * will be set the the limit offset of the text which can be
- * rendered using the returned font.
- * @param limit - the limit offset for the input text.
- * @param script - the script hint.
- * @param success - set to an error code if the arguments are illegal, or no font
- * can be returned for some reason. May also be set to
- * LE_NO_SUBFONT_WARNING
if the subfont which
- * was returned cannot render all of the text.
- *
- * @return an LEFontInstance
for the sub font which can render the characters, or
- * nullptr
if there is an error.
- *
- * @see LEScripts.h
- */
- virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const;
-
- /**
- * This method maps a single character to a glyph index, using the
- * font's character to glyph map.
- *
- * @param ch - the character
- *
- * @return the glyph index
- */
- virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
-
- virtual const void *getFontTable(LETag tableTag) const;
-
- virtual le_int32 getUnitsPerEM() const;
-
- virtual le_int32 getAscent() const;
-
- virtual le_int32 getDescent() const;
-
- virtual le_int32 getLeading() const;
-
- virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
-
- virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
-
- float getXPixelsPerEm() const;
-
- float getYPixelsPerEm() const;
-
- float getScaleFactorX() const;
-
- float getScaleFactorY() const;
-
- /**
- * ICU "poor man's RTTI", returns a UClassID for the actual class.
- */
- virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
-
- /**
- * ICU "poor man's RTTI", returns a UClassID for this class.
- */
- static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
-
-protected:
- FontMap *fFontMap;
-
-private:
-
- /**
- * The address of this static class variable serves as this class's ID
- * for ICU "poor man's RTTI".
- */
- static const char fgClassID;
-};
-
-inline const void *ScriptCompositeFontInstance::getFontTable(LETag /*tableTag*/) const
-{
- return nullptr;
-}
-
-// Can't get units per EM without knowing which sub-font, so
-// return a value that will make units == points
-inline le_int32 ScriptCompositeFontInstance::getUnitsPerEM() const
-{
- return 1;
-}
-
-inline le_int32 ScriptCompositeFontInstance::getAscent() const
-{
- return fFontMap->getAscent();
-}
-
-inline le_int32 ScriptCompositeFontInstance::getDescent() const
-{
- return fFontMap->getDescent();
-}
-
-inline le_int32 ScriptCompositeFontInstance::getLeading() const
-{
- return fFontMap->getLeading();
-}
-
-inline float ScriptCompositeFontInstance::getXPixelsPerEm() const
-{
- return fFontMap->getPointSize();
-}
-
-inline float ScriptCompositeFontInstance::getYPixelsPerEm() const
-{
- return fFontMap->getPointSize();
-}
-
-// Can't get a scale factor without knowing the sub-font, so
-// return 1.0.
-inline float ScriptCompositeFontInstance::getScaleFactorX() const
-{
- return 1.0;
-}
-
-// Can't get a scale factor without knowing the sub-font, so
-// return 1.0
-inline float ScriptCompositeFontInstance::getScaleFactorY() const
-{
- return 1.0;
-}
-
-// U_NAMESPACE_END
-#endif
diff --git a/icu4c/source/samples/layout/Surface.cpp b/icu4c/source/samples/layout/Surface.cpp
deleted file mode 100644
index 5b0686a07ec..00000000000
--- a/icu4c/source/samples/layout/Surface.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * Copyright (C) 2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- */
-void GDISurface::setFont(RenderingFontInstance *font)
-{
- GDIFontInstance *gFont = (GDIFontInstance *) font;
-
- if (fCurrentFont != font) {
- fCurrentFont = font;
- SelectObject(fHdc, gFont->fFont);
- }
-}
-
-void GDISurface::drawGlyphs(RenderingFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const le_int32 *dx,
- le_int32 x, le_int32 y, le_int32 width, le_int32 height)
-{
- RECT clip;
-
- clip.top = 0;
- clip.left = 0;
- clip.bottom = height;
- clip.right = width;
-
- setFont(font);
-
- ExtTextOut(fHdc, x, y - fAscent, ETO_CLIPPED | ETO_GLYPH_INDEX, &clip,
- glyphs, count, (INT *) dx);
-}
-
diff --git a/icu4c/source/samples/layout/Surface.h b/icu4c/source/samples/layout/Surface.h
deleted file mode 100644
index 40a0c5d4bf2..00000000000
--- a/icu4c/source/samples/layout/Surface.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * Copyright (C) 2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- */
-class Surface
-{
-public:
- Surface(/*what?*/);
-
- void setFont(RenderingFontInstance *font);
-
- void drawGlyphs(RenderingFontInstance *font, const LEGlyphID *glyphs, le_int32 count, const le_int32 *dx,
- le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-};
diff --git a/icu4c/source/samples/layout/UnicodeReader.cpp b/icu4c/source/samples/layout/UnicodeReader.cpp
deleted file mode 100644
index fc41dc38660..00000000000
--- a/icu4c/source/samples/layout/UnicodeReader.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2005, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#include
-#include
-#include
-
-#include "unicode/utypes.h"
-#include "unicode/unistr.h"
-
-#include "layout/LETypes.h"
-
-#include "GUISupport.h"
-#include "UnicodeReader.h"
-
-using icu::UnicodeString;
-
-#define BYTE(b) (((int) b) & 0xFF)
-
-/*
- * Read the text from a file. The text must start with a Unicode Byte
- * Order Mark (BOM) so that we know what order to read the bytes in.
- */
-const char16_t *UnicodeReader::readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount)
-{
- FILE *f;
- int32_t fileSize;
-
- char16_t *charBuffer;
- char *byteBuffer;
- char startBytes[4] = {'\xA5', '\xA5', '\xA5', '\xA5'};
- char errorMessage[128];
- const char *cp = "";
- int32_t signatureLength = 0;
-
- f = fopen(fileName, "rb");
-
- if( f == nullptr ) {
- sprintf(errorMessage,"Couldn't open %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- return nullptr;
- }
-
- fseek(f, 0, SEEK_END);
- fileSize = ftell(f);
-
- fseek(f, 0, SEEK_SET);
- fread(startBytes, sizeof(char), 4, f);
-
- if (startBytes[0] == '\xFE' && startBytes[1] == '\xFF') {
- cp = "UTF-16BE";
- signatureLength = 2;
- } else if (startBytes[0] == '\xFF' && startBytes[1] == '\xFE') {
- if (startBytes[2] == '\x00' && startBytes[3] == '\x00') {
- cp = "UTF-32LE";
- signatureLength = 4;
- } else {
- cp = "UTF-16LE";
- signatureLength = 2;
- }
- } else if (startBytes[0] == '\xEF' && startBytes[1] == '\xBB' && startBytes[2] == '\xBF') {
- cp = "UTF-8";
- signatureLength = 3;
- } else if (startBytes[0] == '\x0E' && startBytes[1] == '\xFE' && startBytes[2] == '\xFF') {
- cp = "SCSU";
- signatureLength = 3;
- } else if (startBytes[0] == '\x00' && startBytes[1] == '\x00' &&
- startBytes[2] == '\xFE' && startBytes[3] == '\xFF') {
- cp = "UTF-32BE";
- signatureLength = 4;
- } else {
- sprintf(errorMessage, "Couldn't detect the encoding of %s: (%2.2X, %2.2X, %2.2X, %2.2X)\n", fileName,
- BYTE(startBytes[0]), BYTE(startBytes[1]), BYTE(startBytes[2]), BYTE(startBytes[3]));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- fclose(f);
- return nullptr;
- }
-
- fileSize -= signatureLength;
- fseek(f, signatureLength, SEEK_SET);
- byteBuffer = new char[fileSize];
-
- if (byteBuffer == nullptr) {
- sprintf(errorMessage,"Couldn't get memory for reading %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- fclose(f);
- return nullptr;
- }
-
- fread(byteBuffer, sizeof(char), fileSize, f);
- if( ferror(f) ) {
- sprintf(errorMessage,"Couldn't read %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- fclose(f);
- delete[] byteBuffer;
- return nullptr;
- }
- fclose(f);
-
- UnicodeString myText(byteBuffer, fileSize, cp);
-
- delete[] byteBuffer;
-
- charCount = myText.length();
- charBuffer = LE_NEW_ARRAY(char16_t, charCount + 1);
- if (charBuffer == nullptr) {
- sprintf(errorMessage,"Couldn't get memory for reading %s: %s \n", fileName, strerror(errno));
- guiSupport->postErrorMessage(errorMessage, "Text File Error");
- return nullptr;
- }
-
- myText.extract(0, myText.length(), charBuffer);
- charBuffer[charCount] = 0; // NUL terminate for easier reading in the debugger
-
- return charBuffer;
-}
-
diff --git a/icu4c/source/samples/layout/UnicodeReader.h b/icu4c/source/samples/layout/UnicodeReader.h
deleted file mode 100644
index 6868f403b77..00000000000
--- a/icu4c/source/samples/layout/UnicodeReader.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- ******************************************************************************
- * В© 2016 and later: Unicode, Inc. and others. *
- * License & terms of use: http://www.unicode.org/copyright.html *
- ******************************************************************************
- ******************************************************************************
- * Copyright (C) 1998-2001, International Business Machines Corporation and *
- * others. All Rights Reserved. *
- ******************************************************************************
- */
-
-#ifndef __UNICODEREADER_H
-#define __UNICODEREADER_H
-
-#include "unicode/utypes.h"
-
-#include "GUISupport.h"
-
-class UnicodeReader
-{
-public:
- UnicodeReader()
- {
- // nothing...
- }
-
- ~UnicodeReader()
- {
- // nothing, too
- }
-
- static const char16_t *readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount);
-};
-
-#endif
-
diff --git a/icu4c/source/samples/layout/arraymem.h b/icu4c/source/samples/layout/arraymem.h
deleted file mode 100644
index 8939984afc3..00000000000
--- a/icu4c/source/samples/layout/arraymem.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __ARRAYMEM_H
-#define __ARRAYMEM_H
-
-#include
-
-#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
-
-#define ARRAY_COPY(dst, src, count) memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
-
-#define NEW_ARRAY(type,count) (type *) malloc((count) * sizeof(type))
-
-#define DELETE_ARRAY(array) free((void *) (array))
-
-#define GROW_ARRAY(array,newSize) realloc((void *) (array), (newSize) * sizeof (array)[0])
-
-#endif
diff --git a/icu4c/source/samples/layout/cgnomelayout.c b/icu4c/source/samples/layout/cgnomelayout.c
deleted file mode 100644
index 24d86ef95bd..00000000000
--- a/icu4c/source/samples/layout/cgnomelayout.c
+++ /dev/null
@@ -1,350 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- */
-
-#include
-
-#include
-#include
-#include FT_FREETYPE_H
-
-#include "pflow.h"
-
-#include "gnomeglue.h"
-
-#include "arraymem.h"
-
-struct Context
-{
- long width;
- long height;
- pf_flow *paragraph;
-};
-
-typedef struct Context Context;
-
-static FT_Library engine;
-static gs_guiSupport *guiSupport;
-static fm_fontMap *fontMap;
-static le_font *font;
-
-static GSList *appList = NULL;
-
-GtkWidget *newSample(const gchar *fileName);
-void closeSample(GtkWidget *sample);
-
-static void showabout(GtkWidget *widget, gpointer data)
-{
- GtkWidget *aboutBox;
- const gchar *documentedBy[] = {NULL};
- const gchar *writtenBy[] = {
- "Eric Mader",
- NULL
- };
-
- aboutBox = gnome_about_new("Gnome Layout Sample",
- "0.1",
- "Copyright (C) 1998-2006 By International Business Machines Corporation and others. All Rights Reserved.",
- "A simple demo of the ICU LayoutEngine.",
- writtenBy,
- documentedBy,
- "",
- NULL);
-
- gtk_widget_show(aboutBox);
-}
-
-#if 0
-static void notimpl(GtkObject *object, gpointer data)
-{
- gnome_ok_dialog("Not implemented...");
-}
-#endif
-
-static gchar *prettyTitle(const gchar *path)
-{
- const gchar *name = g_basename(path);
- gchar *title = g_strconcat("Gnome Layout Sample - ", name, NULL);
-
- return title;
-}
-
-static void openOK(GtkObject *object, gpointer data)
-{
- GtkFileSelection *fileselection = GTK_FILE_SELECTION(data);
- GtkWidget *app = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(fileselection), "app"));
- Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
- gchar *fileName = g_strdup(gtk_file_selection_get_filename(fileselection));
- pf_flow *newPara;
-
- gtk_widget_destroy(GTK_WIDGET(fileselection));
-
- newPara = pf_factory(fileName, font, guiSupport);
-
- if (newPara != NULL) {
- gchar *title = prettyTitle(fileName);
- GtkWidget *area = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(app), "area"));
-
- if (context->paragraph != NULL) {
- pf_close(context->paragraph);
- }
-
- context->paragraph = newPara;
- gtk_window_set_title(GTK_WINDOW(app), title);
-
- gtk_widget_hide(area);
- pf_breakLines(context->paragraph, context->width, context->height);
- gtk_widget_show_all(area);
-
- g_free(title);
- }
-
- g_free(fileName);
-}
-
-static void openfile(GtkObject *object, gpointer data)
-{
- GtkWidget *app = GTK_WIDGET(data);
- GtkWidget *fileselection;
- GtkWidget *okButton;
- GtkWidget *cancelButton;
-
- fileselection =
- gtk_file_selection_new("Open File");
-
- gtk_object_set_data(GTK_OBJECT(fileselection), "app", app);
-
- okButton =
- GTK_FILE_SELECTION(fileselection)->ok_button;
-
- cancelButton =
- GTK_FILE_SELECTION(fileselection)->cancel_button;
-
- gtk_signal_connect(GTK_OBJECT(fileselection), "destroy",
- GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
-
- gtk_signal_connect(GTK_OBJECT(okButton), "clicked",
- GTK_SIGNAL_FUNC(openOK), fileselection);
-
- gtk_signal_connect_object(GTK_OBJECT(cancelButton), "clicked",
- GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(fileselection));
-
- gtk_window_set_modal(GTK_WINDOW(fileselection), true);
- gtk_widget_show(fileselection);
- gtk_main();
-}
-
-static void newapp(GtkObject *object, gpointer data)
-{
- GtkWidget *app = newSample("Sample.txt");
-
- gtk_widget_show_all(app);
-}
-
-static void closeapp(GtkWidget *widget, gpointer data)
-{
- GtkWidget *app = GTK_WIDGET(data);
-
- closeSample(app);
-}
-
-static void shutdown(GtkObject *object, gpointer data)
-{
- gtk_main_quit();
-}
-
-GnomeUIInfo fileMenu[] =
-{
- GNOMEUIINFO_MENU_NEW_ITEM((gchar *) "_New Sample",
- (gchar *) "Create a new Gnome Layout Sample",
- newapp, NULL),
-
- GNOMEUIINFO_MENU_OPEN_ITEM(openfile, NULL),
- GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_CLOSE_ITEM(closeapp, NULL),
- GNOMEUIINFO_MENU_EXIT_ITEM(shutdown, NULL),
- GNOMEUIINFO_END
-};
-
-GnomeUIInfo helpMenu[] =
-{
- /* GNOMEUIINFO_HELP("gnomelayout"), */
- GNOMEUIINFO_MENU_ABOUT_ITEM(showabout, NULL),
- GNOMEUIINFO_END
-};
-
-GnomeUIInfo mainMenu[] =
-{
- GNOMEUIINFO_SUBTREE(N_((gchar *) "File"), fileMenu),
- GNOMEUIINFO_SUBTREE(N_((gchar *) "Help"), helpMenu),
- GNOMEUIINFO_END
-};
-
-static gint eventDelete(GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- closeSample(widget);
-
- /* indicate that closeapp already destroyed the window */
- return true;
-}
-
-static gint eventConfigure(GtkWidget *widget, GdkEventConfigure *event, Context *context)
-{
- if (context->paragraph != NULL) {
- context->width = event->width;
- context->height = event->height;
-
- if (context->width > 0 && context->height > 0) {
- pf_breakLines(context->paragraph, context->width, context->height);
- }
- }
-
- return true;
-}
-
-static gint eventExpose(GtkWidget *widget, GdkEvent *event, Context *context)
-{
- if (context->paragraph != NULL) {
- gint maxLines = pf_getLineCount(context->paragraph) - 1;
- gint firstLine = 0, lastLine = context->height / pf_getLineHeight(context->paragraph);
- rs_surface *surface = rs_gnomeRenderingSurfaceOpen(widget);
-
- pf_draw(context->paragraph, surface, firstLine, (maxLines < lastLine)? maxLines : lastLine);
-
- rs_gnomeRenderingSurfaceClose(surface);
- }
-
- return true;
-}
-
-GtkWidget *newSample(const gchar *fileName)
-{
- Context *context = NEW_ARRAY(Context, 1);
- gchar *title;
- GtkWidget *app;
- GtkWidget *area;
- GtkStyle *style;
- int i;
-
- context->width = 600;
- context->height = 400;
- context->paragraph = pf_factory(fileName, font, guiSupport);
-
- title = prettyTitle(fileName);
- app = gnome_app_new("gnomeLayout", title);
-
- gtk_object_set_data(GTK_OBJECT(app), "context", context);
-
- gtk_window_set_default_size(GTK_WINDOW(app), 600 - 24, 400);
-
- gnome_app_create_menus_with_data(GNOME_APP(app), mainMenu, app);
-
- gtk_signal_connect(GTK_OBJECT(app), "delete_event",
- GTK_SIGNAL_FUNC(eventDelete), NULL);
-
- area = gtk_drawing_area_new();
- gtk_object_set_data(GTK_OBJECT(app), "area", area);
-
- style = gtk_style_copy(gtk_widget_get_style(area));
-
- for (i = 0; i < 5; i += 1) {
- style->fg[i] = style->white;
- }
-
- gtk_widget_set_style(area, style);
-
- gnome_app_set_contents(GNOME_APP(app), area);
-
- gtk_signal_connect(GTK_OBJECT(area),
- "expose_event",
- GTK_SIGNAL_FUNC(eventExpose),
- context);
-
- gtk_signal_connect(GTK_OBJECT(area),
- "configure_event",
- GTK_SIGNAL_FUNC(eventConfigure),
- context);
-
- appList = g_slist_prepend(appList, app);
-
- g_free(title);
-
- return app;
-}
-
-void closeSample(GtkWidget *app)
-{
- Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
-
- if (context->paragraph != NULL) {
- pf_close(context->paragraph);
- }
-
- DELETE_ARRAY(context);
-
- appList = g_slist_remove(appList, app);
-
- gtk_widget_destroy(app);
-
- if (appList == NULL) {
- gtk_main_quit();
- }
-}
-
-int main (int argc, char *argv[])
-{
- LEErrorCode fontStatus = LE_NO_ERROR;
- poptContext ptctx;
- GtkWidget *app;
- const char *defaultArgs[] = {"Sample.txt", NULL};
- const char **args;
- int i;
-
- FT_Init_FreeType(&engine);
-
- gnome_init_with_popt_table("gnomelayout", "0.1", argc, argv, NULL, 0, &ptctx);
-
- guiSupport = gs_gnomeGuiSupportOpen();
- fontMap = fm_gnomeFontMapOpen(engine, "FontMap.Gnome", 24, guiSupport, &fontStatus);
- font = le_scriptCompositeFontOpen(fontMap);
-
- if (LE_FAILURE(fontStatus)) {
- FT_Done_FreeType(engine);
- return 1;
- }
-
- args = poptGetArgs(ptctx);
-
- if (args == NULL) {
- args = defaultArgs;
- }
-
- for (i = 0; args[i] != NULL; i += 1) {
- app = newSample(args[i]);
-
- gtk_widget_show_all(app);
- }
-
- poptFreeContext(ptctx);
-
- gtk_main();
-
- le_fontClose(font);
- gs_gnomeGuiSupportClose(guiSupport);
-
- FT_Done_FreeType(engine);
-
- exit(0);
-}
diff --git a/icu4c/source/samples/layout/clayout.c b/icu4c/source/samples/layout/clayout.c
deleted file mode 100644
index b1077102170..00000000000
--- a/icu4c/source/samples/layout/clayout.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Layout.cpp
- *
- * created on: 08/03/2000
- * created by: Eric R. Mader
- */
-
-#include
-#include
-#include
-
-#include "playout.h"
-#include "pflow.h"
-
-#include "gdiglue.h"
-#include "ucreader.h"
-
-#include "arraymem.h"
-
-#include "resource.h"
-
-struct Context
-{
- le_int32 width;
- le_int32 height;
- pf_flow *paragraph;
-};
-
-typedef struct Context Context;
-
-LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
-
-#define APP_NAME "LayoutSample"
-
-TCHAR szAppName[] = TEXT(APP_NAME);
-
-void PrettyTitle(HWND hwnd, char *fileName)
-{
- char title[MAX_PATH + 64];
-
- sprintf(title, "%s - %s", APP_NAME, fileName);
-
- SetWindowTextA(hwnd, title);
-}
-
-void InitParagraph(HWND hwnd, Context *context)
-{
- SCROLLINFO si;
-
- if (context->paragraph != NULL) {
- // FIXME: does it matter what we put in the ScrollInfo
- // if the window's been minimized?
- if (context->width > 0 && context->height > 0) {
- pf_breakLines(context->paragraph, context->width, context->height);
- }
-
- si.cbSize = sizeof si;
- si.fMask = SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL;
- si.nMin = 0;
- si.nMax = pf_getLineCount(context->paragraph) - 1;
- si.nPage = context->height / pf_getLineHeight(context->paragraph);
- SetScrollInfo(hwnd, SB_VERT, &si, true);
- }
-}
-
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
-{
- HWND hwnd;
- HACCEL hAccel;
- MSG msg;
- WNDCLASS wndclass;
- LEErrorCode status = LE_NO_ERROR;
-
- wndclass.style = CS_HREDRAW | CS_VREDRAW;
- wndclass.lpfnWndProc = WndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = sizeof(LONG);
- wndclass.hInstance = hInstance;
- wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
- wndclass.lpszMenuName = szAppName;
- wndclass.lpszClassName = szAppName;
-
- if (!RegisterClass(&wndclass)) {
- MessageBox(NULL, TEXT("This demo only runs on Windows 2000!"), szAppName, MB_ICONERROR);
-
- return 0;
- }
-
- hAccel = LoadAccelerators(hInstance, szAppName);
-
- hwnd = CreateWindow(szAppName, NULL,
- WS_OVERLAPPEDWINDOW | WS_VSCROLL,
- CW_USEDEFAULT, CW_USEDEFAULT,
- 600, 400,
- NULL, NULL, hInstance, NULL);
-
- ShowWindow(hwnd, iCmdShow);
- UpdateWindow(hwnd);
-
- while (GetMessage(&msg, NULL, 0, 0)) {
- if (!TranslateAccelerator(hwnd, hAccel, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
- UnregisterClass(szAppName, hInstance);
- return msg.wParam;
-}
-
-LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- HDC hdc;
- Context *context;
- static le_int32 windowCount = 0;
- static fm_fontMap *fontMap = NULL;
- static rs_surface *surface = NULL;
- static gs_guiSupport *guiSupport = NULL;
- static le_font *font = NULL;
-
- switch (message) {
- case WM_CREATE:
- {
- LEErrorCode fontStatus = LE_NO_ERROR;
-
- hdc = GetDC(hwnd);
- guiSupport = gs_gdiGuiSupportOpen();
- surface = rs_gdiRenderingSurfaceOpen(hdc);
-
- fontMap = fm_gdiFontMapOpen(surface, "FontMap.GDI", 24, guiSupport, &fontStatus);
- font = le_scriptCompositeFontOpen(fontMap);
-
- if (LE_FAILURE(fontStatus)) {
- ReleaseDC(hwnd, hdc);
- return -1;
- }
-
- context = NEW_ARRAY(Context, 1);
-
- context->width = 600;
- context->height = 400;
-
- context->paragraph = pf_factory("Sample.txt", font, guiSupport);
- SetWindowLongPtr(hwnd, 0, (LONG_PTR) context);
-
- windowCount += 1;
- ReleaseDC(hwnd, hdc);
-
- PrettyTitle(hwnd, "Sample.txt");
- return 0;
- }
-
- case WM_SIZE:
- {
- context = (Context *) GetWindowLongPtr(hwnd, 0);
- context->width = LOWORD(lParam);
- context->height = HIWORD(lParam);
-
- InitParagraph(hwnd, context);
- return 0;
- }
-
- case WM_VSCROLL:
- {
- SCROLLINFO si;
- le_int32 vertPos;
-
- si.cbSize = sizeof si;
- si.fMask = SIF_ALL;
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- vertPos = si.nPos;
-
- switch (LOWORD(wParam))
- {
- case SB_TOP:
- si.nPos = si.nMin;
- break;
-
- case SB_BOTTOM:
- si.nPos = si.nMax;
- break;
-
- case SB_LINEUP:
- si.nPos -= 1;
- break;
-
- case SB_LINEDOWN:
- si.nPos += 1;
- break;
-
- case SB_PAGEUP:
- si.nPos -= si.nPage;
- break;
-
- case SB_PAGEDOWN:
- si.nPos += si.nPage;
- break;
-
- case SB_THUMBTRACK:
- si.nPos = si.nTrackPos;
- break;
-
- default:
- break;
- }
-
- si.fMask = SIF_POS;
- SetScrollInfo(hwnd, SB_VERT, &si, true);
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- context = (Context *) GetWindowLongPtr(hwnd, 0);
-
- if (context->paragraph != NULL && si.nPos != vertPos) {
- ScrollWindow(hwnd, 0, pf_getLineHeight(context->paragraph) * (vertPos - si.nPos), NULL, NULL);
- UpdateWindow(hwnd);
- }
-
- return 0;
- }
-
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- SCROLLINFO si;
- le_int32 firstLine, lastLine;
-
- hdc = BeginPaint(hwnd, &ps);
- SetBkMode(hdc, TRANSPARENT);
-
- si.cbSize = sizeof si;
- si.fMask = SIF_ALL;
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- firstLine = si.nPos;
-
- context = (Context *) GetWindowLongPtr(hwnd, 0);
-
- if (context->paragraph != NULL) {
- rs_gdiRenderingSurfaceSetHDC(surface, hdc);
-
- // NOTE: si.nPos + si.nPage may include a partial line at the bottom
- // of the window. We need this because scrolling assumes that the
- // partial line has been painted.
- lastLine = min (si.nPos + (le_int32) si.nPage, pf_getLineCount(context->paragraph) - 1);
-
- pf_draw(context->paragraph, surface, firstLine, lastLine);
- }
-
- EndPaint(hwnd, &ps);
- return 0;
- }
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDM_FILE_OPEN:
- {
- OPENFILENAMEA ofn;
- char szFileName[MAX_PATH], szTitleName[MAX_PATH];
- static char szFilter[] = "Text Files (.txt)\0*.txt\0"
- "All Files (*.*)\0*.*\0\0";
-
- ofn.lStructSize = sizeof (OPENFILENAMEA);
- ofn.hwndOwner = hwnd;
- ofn.hInstance = NULL;
- ofn.lpstrFilter = szFilter;
- ofn.lpstrCustomFilter = NULL;
- ofn.nMaxCustFilter = 0;
- ofn.nFilterIndex = 0;
- ofn.lpstrFile = szFileName;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrFileTitle = szTitleName;
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrInitialDir = NULL;
- ofn.lpstrTitle = NULL;
- ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
- ofn.nFileOffset = 0;
- ofn.nFileExtension = 0;
- ofn.lpstrDefExt = "txt";
- ofn.lCustData = 0L;
- ofn.lpfnHook = NULL;
- ofn.lpTemplateName = NULL;
-
- szFileName[0] = '\0';
-
- if (GetOpenFileNameA(&ofn)) {
- pf_flow *newParagraph;
-
- hdc = GetDC(hwnd);
- rs_gdiRenderingSurfaceSetHDC(surface, hdc);
-
- newParagraph = pf_factory(szFileName, font, guiSupport);
-
- if (newParagraph != NULL) {
- context = (Context *) GetWindowLongPtr(hwnd, 0);
-
- if (context->paragraph != NULL) {
- pf_close(context->paragraph);
- }
-
- context->paragraph = newParagraph;
- InitParagraph(hwnd, context);
- PrettyTitle(hwnd, szTitleName);
- InvalidateRect(hwnd, NULL, true);
-
- }
- }
-
- //ReleaseDC(hwnd, hdc);
-
- return 0;
- }
-
- case IDM_FILE_EXIT:
- case IDM_FILE_CLOSE:
- SendMessage(hwnd, WM_CLOSE, 0, 0);
- return 0;
-
- case IDM_HELP_ABOUTLAYOUTSAMPLE:
- MessageBox(hwnd, TEXT("Windows Layout Sample 0.1\n")
- TEXT("Copyright (C) 1998-2005 By International Business Machines Corporation and others.\n")
- TEXT("Author: Eric Mader"),
- szAppName, MB_ICONINFORMATION | MB_OK);
- return 0;
-
- }
- break;
-
-
- case WM_DESTROY:
- {
- context = (Context *) GetWindowLongPtr(hwnd, 0);
-
- if (context != NULL && context->paragraph != NULL) {
- pf_close(context->paragraph);
- }
-
- DELETE_ARRAY(context);
-
- if (--windowCount <= 0) {
- le_fontClose(font);
- rs_gdiRenderingSurfaceClose(surface);
- gs_gdiGuiSupportClose(guiSupport);
-
- PostQuitMessage(0);
- }
-
- return 0;
- }
-
- default:
- return DefWindowProc(hwnd, message, wParam, lParam);
- }
-
- return 0;
-}
diff --git a/icu4c/source/samples/layout/cmaps.cpp b/icu4c/source/samples/layout/cmaps.cpp
deleted file mode 100644
index 41500889bf8..00000000000
--- a/icu4c/source/samples/layout/cmaps.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: cmaps.cpp
- *
- * created on: ??/??/2001
- * created by: Eric R. Mader
- */
-
-#include "layout/LETypes.h"
-#include "layout/LESwaps.h"
-
-#include "sfnt.h"
-#include "cmaps.h"
-
-#define SWAPU16(code) ((LEUnicode16) SWAPW(code))
-#define SWAPU32(code) ((LEUnicode32) SWAPL(code))
-
-using icu::LESwaps;
-
-//
-// Finds the high bit by binary searching
-// through the bits in value.
-//
-le_uint8 highBit(le_uint32 value)
-{
- le_uint8 bit = 0;
-
- if (value >= 1 << 16) {
- value >>= 16;
- bit += 16;
- }
-
- if (value >= 1 << 8) {
- value >>= 8;
- bit += 8;
- }
-
- if (value >= 1 << 4) {
- value >>= 4;
- bit += 4;
- }
-
- if (value >= 1 << 2) {
- value >>= 2;
- bit += 2;
- }
-
- if (value >= 1 << 1) {
- value >>= 1;
- bit += 1;
- }
-
- return bit;
-}
-
-CMAPMapper *CMAPMapper::createUnicodeMapper(const CMAPTable *cmap)
-{
- le_uint16 i;
- le_uint16 nSubtables = SWAPW(cmap->numberSubtables);
- const CMAPEncodingSubtable *subtable = nullptr;
- le_uint32 offset1 = 0, offset10 = 0;
-
- for (i = 0; i < nSubtables; i += 1) {
- const CMAPEncodingSubtableHeader *esh = &cmap->encodingSubtableHeaders[i];
-
- if (SWAPW(esh->platformID) == 3) {
- switch (SWAPW(esh->platformSpecificID)) {
- case 1:
- offset1 = SWAPL(esh->encodingOffset);
- break;
-
- case 10:
- offset10 = SWAPL(esh->encodingOffset);
- break;
- }
- }
- }
-
-
- if (offset10 != 0)
- {
- subtable = (const CMAPEncodingSubtable *) ((const char *) cmap + offset10);
- } else if (offset1 != 0) {
- subtable = (const CMAPEncodingSubtable *) ((const char *) cmap + offset1);
- } else {
- return nullptr;
- }
-
- switch (SWAPW(subtable->format)) {
- case 4:
- return new CMAPFormat4Mapper(cmap, (const CMAPFormat4Encoding *) subtable);
-
- case 12:
- {
- const CMAPFormat12Encoding *encoding = (const CMAPFormat12Encoding *) subtable;
-
- return new CMAPGroupMapper(cmap, encoding->groups, SWAPL(encoding->nGroups));
- }
-
- default:
- break;
- }
-
- return nullptr;
-}
-
-CMAPFormat4Mapper::CMAPFormat4Mapper(const CMAPTable *cmap, const CMAPFormat4Encoding *header)
- : CMAPMapper(cmap)
-{
- le_uint16 segCount = SWAPW(header->segCountX2) / 2;
-
- fEntrySelector = SWAPW(header->entrySelector);
- fRangeShift = SWAPW(header->rangeShift) / 2;
- fEndCodes = &header->endCodes[0];
- fStartCodes = &header->endCodes[segCount + 1]; // + 1 for reservedPad...
- fIdDelta = &fStartCodes[segCount];
- fIdRangeOffset = &fIdDelta[segCount];
-}
-
-LEGlyphID CMAPFormat4Mapper::unicodeToGlyph(LEUnicode32 unicode32) const
-{
- if (unicode32 >= 0x10000) {
- return 0;
- }
-
- LEUnicode16 unicode = (LEUnicode16) unicode32;
- le_uint16 index = 0;
- le_uint16 probe = 1 << fEntrySelector;
- TTGlyphID result = 0;
-
- if (SWAPU16(fStartCodes[fRangeShift]) <= unicode) {
- index = fRangeShift;
- }
-
- while (probe > (1 << 0)) {
- probe >>= 1;
-
- if (SWAPU16(fStartCodes[index + probe]) <= unicode) {
- index += probe;
- }
- }
-
- if (unicode >= SWAPU16(fStartCodes[index]) && unicode <= SWAPU16(fEndCodes[index])) {
- if (fIdRangeOffset[index] == 0) {
- result = (TTGlyphID) unicode;
- } else {
- le_uint16 offset = unicode - SWAPU16(fStartCodes[index]);
- le_uint16 rangeOffset = SWAPW(fIdRangeOffset[index]);
- le_uint16 *glyphIndexTable = (le_uint16 *) ((char *) &fIdRangeOffset[index] + rangeOffset);
-
- result = SWAPW(glyphIndexTable[offset]);
- }
-
- result += SWAPW(fIdDelta[index]);
- } else {
- result = 0;
- }
-
- return LE_SET_GLYPH(0, result);
-}
-
-CMAPFormat4Mapper::~CMAPFormat4Mapper()
-{
- // parent destructor does it all
-}
-
-CMAPGroupMapper::CMAPGroupMapper(const CMAPTable *cmap, const CMAPGroup *groups, le_uint32 nGroups)
- : CMAPMapper(cmap), fGroups(groups)
-{
- le_uint8 bit = highBit(nGroups);
- fPower = 1 << bit;
- fRangeOffset = nGroups - fPower;
-}
-
-LEGlyphID CMAPGroupMapper::unicodeToGlyph(LEUnicode32 unicode32) const
-{
- le_int32 probe = fPower;
- le_int32 range = 0;
-
- if (SWAPU32(fGroups[fRangeOffset].startCharCode) <= unicode32) {
- range = fRangeOffset;
- }
-
- while (probe > (1 << 0)) {
- probe >>= 1;
-
- if (SWAPU32(fGroups[range + probe].startCharCode) <= unicode32) {
- range += probe;
- }
- }
-
- if (SWAPU32(fGroups[range].startCharCode) <= unicode32 && SWAPU32(fGroups[range].endCharCode) >= unicode32) {
- return (LEGlyphID) (SWAPU32(fGroups[range].startGlyphCode) + unicode32 - SWAPU32(fGroups[range].startCharCode));
- }
-
- return 0;
-}
-
-CMAPGroupMapper::~CMAPGroupMapper()
-{
- // parent destructor does it all
-}
-
diff --git a/icu4c/source/samples/layout/cmaps.h b/icu4c/source/samples/layout/cmaps.h
deleted file mode 100644
index 35fc2e0804c..00000000000
--- a/icu4c/source/samples/layout/cmaps.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- ******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- ******************************************************************************
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2003, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: cmaps.h
- *
- * created on: ??/??/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __CMAPS_H
-#define __CMAPS_H
-
-#include "layout/LETypes.h"
-#include "sfnt.h"
-
-class CMAPMapper
-{
-public:
- virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const = 0;
-
- virtual ~CMAPMapper();
-
- static CMAPMapper *createUnicodeMapper(const CMAPTable *cmap);
-
-protected:
- CMAPMapper(const CMAPTable *cmap);
-
- CMAPMapper() {};
-
-private:
- const CMAPTable *fcmap;
-};
-
-class CMAPFormat4Mapper : public CMAPMapper
-{
-public:
- CMAPFormat4Mapper(const CMAPTable *cmap, const CMAPFormat4Encoding *header);
-
- virtual ~CMAPFormat4Mapper();
-
- virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const;
-
-protected:
- CMAPFormat4Mapper() {};
-
-private:
- le_uint16 fEntrySelector;
- le_uint16 fRangeShift;
- const le_uint16 *fEndCodes;
- const le_uint16 *fStartCodes;
- const le_uint16 *fIdDelta;
- const le_uint16 *fIdRangeOffset;
-};
-
-class CMAPGroupMapper : public CMAPMapper
-{
-public:
- CMAPGroupMapper(const CMAPTable *cmap, const CMAPGroup *groups, le_uint32 nGroups);
-
- virtual ~CMAPGroupMapper();
-
- virtual LEGlyphID unicodeToGlyph(LEUnicode32 unicode32) const;
-
-protected:
- CMAPGroupMapper() {};
-
-private:
- le_int32 fPower;
- le_int32 fRangeOffset;
- const CMAPGroup *fGroups;
-};
-
-inline CMAPMapper::CMAPMapper(const CMAPTable *cmap)
- : fcmap(cmap)
-{
- // nothing else to do
-}
-
-inline CMAPMapper::~CMAPMapper()
-{
- LE_DELETE_ARRAY(fcmap);
-}
-
-#endif
-
diff --git a/icu4c/source/samples/layout/gdiglue.cpp b/icu4c/source/samples/layout/gdiglue.cpp
deleted file mode 100644
index 49ca8837f49..00000000000
--- a/icu4c/source/samples/layout/gdiglue.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#include
-
-#include "unicode/utypes.h"
-#include "loengine.h"
-#include "rsurface.h"
-#include "gsupport.h"
-
-#include "gdiglue.h"
-
-#include "LETypes.h"
-#include "LEFontInstance.h"
-#include "GDIGUISupport.h"
-#include "GDIFontMap.h"
-#include "ScriptCompositeFontInstance.h"
-
-
-U_CDECL_BEGIN
-
-gs_guiSupport *gs_gdiGuiSupportOpen()
-{
- return (gs_guiSupport *) new GDIGUISupport();
-}
-
-void gs_gdiGuiSupportClose(gs_guiSupport *guiSupport)
-{
- GDIGUISupport *gs = (GDIGUISupport *) guiSupport;
-
- delete gs;
-}
-
-rs_surface *rs_gdiRenderingSurfaceOpen(HDC hdc)
-{
- return (rs_surface *) new GDISurface(hdc);
-}
-
-void rs_gdiRenderingSurfaceSetHDC(rs_surface *surface, HDC hdc)
-{
- GDISurface *rs = (GDISurface *) surface;
-
- rs->setHDC(hdc);
-}
-
-void rs_gdiRenderingSurfaceClose(rs_surface *surface)
-{
- GDISurface *rs = (GDISurface *) surface;
-
- delete rs;
-}
-
-fm_fontMap *fm_gdiFontMapOpen(rs_surface *surface, const char *fileName, le_int16 pointSize, gs_guiSupport *guiSupport, LEErrorCode *status)
-{
- return (fm_fontMap *) new GDIFontMap((GDISurface *) surface, fileName, pointSize, (GDIGUISupport *) guiSupport, *status);
-}
-
-void fm_fontMapClose(fm_fontMap *fontMap)
-{
- GDIFontMap *fm = (GDIFontMap *) fontMap;
-
- delete fm;
-}
-
-le_font *le_scriptCompositeFontOpen(fm_fontMap *fontMap)
-{
- return (le_font *) new ScriptCompositeFontInstance((FontMap *) fontMap);
-}
-
-void le_fontClose(le_font *font)
-{
- LEFontInstance *fi = (LEFontInstance *) font;
-
- delete fi;
-}
-
-U_CDECL_END
diff --git a/icu4c/source/samples/layout/gdiglue.h b/icu4c/source/samples/layout/gdiglue.h
deleted file mode 100644
index 7efe947a445..00000000000
--- a/icu4c/source/samples/layout/gdiglue.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __GDIGLUE_H
-#define __GDIGLUE_H
-
-#include
-
-#include "unicode/utypes.h"
-
-#include "LETypes.h"
-#include "loengine.h"
-#include "gsupport.h"
-#include "rsurface.h"
-
-typedef void fm_fontMap;
-
-U_CDECL_BEGIN
-
-gs_guiSupport *gs_gdiGuiSupportOpen();
-void gs_gdiGuiSupportClose(gs_guiSupport *guiSupport);
-
-rs_surface *rs_gdiRenderingSurfaceOpen(HDC hdc);
-void rs_gdiRenderingSurfaceSetHDC(rs_surface *surface, HDC hdc);
-void rs_gdiRenderingSurfaceClose(rs_surface *surface);
-
-fm_fontMap *fm_gdiFontMapOpen(rs_surface *surface, const char *fileName, le_int16 pointSize, gs_guiSupport *guiSupport, LEErrorCode *status);
-void fm_fontMapClose(fm_fontMap *fontMap);
-
-le_font *le_scriptCompositeFontOpen(fm_fontMap *fontMap);
-void le_fontClose(le_font *font);
-
-U_CDECL_END
-
-#endif
diff --git a/icu4c/source/samples/layout/gnomeglue.cpp b/icu4c/source/samples/layout/gnomeglue.cpp
deleted file mode 100644
index 2c7100c6965..00000000000
--- a/icu4c/source/samples/layout/gnomeglue.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#include
-#include
-#include FT_FREETYPE_H
-
-#include "unicode/utypes.h"
-#include "layout/loengine.h"
-#include "rsurface.h"
-#include "gsupport.h"
-
-#include "gnomeglue.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-#include "GnomeGUISupport.h"
-#include "GnomeFontMap.h"
-#include "GnomeFontInstance.h"
-#include "ScriptCompositeFontInstance.h"
-
-
-using icu::LEFontInstance;
-
-U_CDECL_BEGIN
-
-gs_guiSupport *gs_gnomeGuiSupportOpen()
-{
- return (gs_guiSupport *) new GnomeGUISupport();
-}
-
-void gs_gnomeGuiSupportClose(gs_guiSupport *guiSupport)
-{
- GnomeGUISupport *gs = (GnomeGUISupport *) guiSupport;
-
- delete gs;
-}
-
-rs_surface *rs_gnomeRenderingSurfaceOpen(GtkWidget *theWidget)
-{
- return (rs_surface *) new GnomeSurface(theWidget);
-}
-
-void rs_gnomeRenderingSurfaceClose(rs_surface *surface)
-{
- GnomeSurface *rs = (GnomeSurface *) surface;
-
- delete rs;
-}
-
-fm_fontMap *fm_gnomeFontMapOpen(FT_Library engine, const char *fileName, le_int16 pointSize, gs_guiSupport *guiSupport, LEErrorCode *status)
-{
- return (fm_fontMap *) new GnomeFontMap(engine, fileName, pointSize, (GnomeGUISupport *) guiSupport, *status);
-}
-
-void fm_fontMapClose(fm_fontMap *fontMap)
-{
- GnomeFontMap *fm = (GnomeFontMap *) fontMap;
-
- delete fm;
-}
-
-le_font *le_scriptCompositeFontOpen(fm_fontMap *fontMap)
-{
- return (le_font *) new ScriptCompositeFontInstance((FontMap *) fontMap);
-}
-
-void le_fontClose(le_font *font)
-{
- LEFontInstance *fi = (LEFontInstance *) font;
-
- delete fi;
-}
-
-U_CDECL_END
diff --git a/icu4c/source/samples/layout/gnomeglue.h b/icu4c/source/samples/layout/gnomeglue.h
deleted file mode 100644
index 8d0336c6b54..00000000000
--- a/icu4c/source/samples/layout/gnomeglue.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __GNOMEGLUE_H
-#define __GNOMEGLUE_H
-
-#include
-#include
-#include FT_FREETYPE_H
-
-#include "unicode/utypes.h"
-
-#include "layout/LETypes.h"
-#include "layout/loengine.h"
-#include "gsupport.h"
-#include "rsurface.h"
-
-typedef void fm_fontMap;
-
-U_CDECL_BEGIN
-
-gs_guiSupport *gs_gnomeGuiSupportOpen(void);
-void gs_gnomeGuiSupportClose(gs_guiSupport *guiSupport);
-
-rs_surface *rs_gnomeRenderingSurfaceOpen(GtkWidget *theWidget);
-void rs_gnomeRenderingSurfaceClose(rs_surface *surface);
-
-fm_fontMap *fm_gnomeFontMapOpen(FT_Library engine, const char *fileName, le_int16 pointSize, gs_guiSupport *guiSupport, LEErrorCode *status);
-void fm_fontMapClose(fm_fontMap *fontMap);
-
-le_font *le_scriptCompositeFontOpen(fm_fontMap *fontMap);
-void le_fontClose(le_font *font);
-
-U_CDECL_END
-
-#endif
diff --git a/icu4c/source/samples/layout/gnomelayout.cpp b/icu4c/source/samples/layout/gnomelayout.cpp
deleted file mode 100644
index 0a7a5ff6ea4..00000000000
--- a/icu4c/source/samples/layout/gnomelayout.cpp
+++ /dev/null
@@ -1,343 +0,0 @@
-
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: gnomelayout.cpp
- *
- * created on: 09/04/2001
- * created by: Eric R. Mader
- */
-
-#include
-#include
-#include FT_FREETYPE_H
-
-#include "unicode/ustring.h"
-#include "unicode/uscript.h"
-
-#include "GnomeFontInstance.h"
-
-#include "paragraph.h"
-
-#include "GnomeGUISupport.h"
-#include "GnomeFontMap.h"
-#include "UnicodeReader.h"
-#include "ScriptCompositeFontInstance.h"
-
-#define ARRAY_LENGTH(array) (sizeof array / sizeof array[0])
-
-struct Context
-{
- long width;
- long height;
- Paragraph *paragraph;
-};
-
-static FT_Library engine;
-static GnomeGUISupport *guiSupport;
-static GnomeFontMap *fontMap;
-static ScriptCompositeFontInstance *font;
-
-static GSList *appList = nullptr;
-
-GtkWidget *newSample(const gchar *fileName);
-void closeSample(GtkWidget *sample);
-
-void showabout(GtkWidget */*widget*/, gpointer /*data*/)
-{
- GtkWidget *aboutBox;
- const gchar *documentedBy[] = {nullptr};
- const gchar *writtenBy[] = {
- "Eric Mader",
- nullptr
- };
-
- aboutBox = gnome_about_new("Gnome Layout Sample",
- "0.1",
- "Copyright (C) 1998-2006 By International Business Machines Corporation and others. All Rights Reserved.",
- "A simple demo of the ICU LayoutEngine.",
- writtenBy,
- documentedBy,
- "",
- nullptr);
-
- gtk_widget_show(aboutBox);
-}
-
-void notimpl(GtkObject */*object*/, gpointer /*data*/)
-{
- gnome_ok_dialog("Not implemented...");
-}
-
-gchar *prettyTitle(const gchar *path)
-{
- const gchar *name = g_basename(path);
- gchar *title = g_strconcat("Gnome Layout Sample - ", name, nullptr);
-
- return title;
-}
-
-void openOK(GtkObject */*object*/, gpointer data)
-{
- GtkFileSelection *fileselection = GTK_FILE_SELECTION(data);
- GtkWidget *app = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(fileselection), "app"));
- Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
- gchar *fileName = g_strdup(gtk_file_selection_get_filename(fileselection));
- Paragraph *newPara;
-
- gtk_widget_destroy(GTK_WIDGET(fileselection));
-
- newPara = Paragraph::paragraphFactory(fileName, font, guiSupport);
-
- if (newPara != nullptr) {
- gchar *title = prettyTitle(fileName);
- GtkWidget *area = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(app), "area"));
-
- delete context->paragraph;
-
- context->paragraph = newPara;
- gtk_window_set_title(GTK_WINDOW(app), title);
-
- gtk_widget_hide(area);
- context->paragraph->breakLines(context->width, context->height);
- gtk_widget_show_all(area);
-
- g_free(title);
- }
-
- g_free(fileName);
-}
-
-void openfile(GtkObject */*object*/, gpointer data)
-{
- GtkWidget *app = GTK_WIDGET(data);
- GtkWidget *fileselection;
- GtkWidget *okButton;
- GtkWidget *cancelButton;
-
- fileselection =
- gtk_file_selection_new("Open File");
-
- gtk_object_set_data(GTK_OBJECT(fileselection), "app", app);
-
- okButton =
- GTK_FILE_SELECTION(fileselection)->ok_button;
-
- cancelButton =
- GTK_FILE_SELECTION(fileselection)->cancel_button;
-
- gtk_signal_connect(GTK_OBJECT(fileselection), "destroy",
- GTK_SIGNAL_FUNC(gtk_main_quit), nullptr);
-
- gtk_signal_connect(GTK_OBJECT(okButton), "clicked",
- GTK_SIGNAL_FUNC(openOK), fileselection);
-
- gtk_signal_connect_object(GTK_OBJECT(cancelButton), "clicked",
- GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(fileselection));
-
- gtk_window_set_modal(GTK_WINDOW(fileselection), true);
- gtk_widget_show(fileselection);
- gtk_main();
-}
-
-void newapp(GtkObject */*object*/, gpointer /*data*/)
-{
- GtkWidget *app = newSample("Sample.txt");
-
- gtk_widget_show_all(app);
-}
-
-void closeapp(GtkWidget */*widget*/, gpointer data)
-{
- GtkWidget *app = GTK_WIDGET(data);
-
- closeSample(app);
-}
-
-void shutdown(GtkObject */*object*/, gpointer /*data*/)
-{
- gtk_main_quit();
-}
-
-GnomeUIInfo fileMenu[] =
-{
- GNOMEUIINFO_MENU_NEW_ITEM((gchar *) "_New Sample",
- (gchar *) "Create a new Gnome Layout Sample",
- newapp, nullptr),
-
- GNOMEUIINFO_MENU_OPEN_ITEM(openfile, nullptr),
- GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_CLOSE_ITEM(closeapp, nullptr),
- GNOMEUIINFO_MENU_EXIT_ITEM(shutdown, nullptr),
- GNOMEUIINFO_END
-};
-
-GnomeUIInfo helpMenu[] =
-{
- // GNOMEUIINFO_HELP("gnomelayout"),
- GNOMEUIINFO_MENU_ABOUT_ITEM(showabout, nullptr),
- GNOMEUIINFO_END
-};
-
-GnomeUIInfo mainMenu[] =
-{
- GNOMEUIINFO_SUBTREE(N_((gchar *) "File"), fileMenu),
- GNOMEUIINFO_SUBTREE(N_((gchar *) "Help"), helpMenu),
- GNOMEUIINFO_END
-};
-
-gint eventDelete(GtkWidget *widget, GdkEvent */*event*/, gpointer /*data*/)
-{
- closeSample(widget);
-
- // indicate that closeapp already destroyed the window
- return true;
-}
-
-gint eventConfigure(GtkWidget */*widget*/, GdkEventConfigure *event, Context *context)
-{
- if (context->paragraph != nullptr) {
- context->width = event->width;
- context->height = event->height;
-
- if (context->width > 0 && context->height > 0) {
- context->paragraph->breakLines(context->width, context->height);
- }
- }
-
- return true;
-}
-
-gint eventExpose(GtkWidget *widget, GdkEvent */*event*/, Context *context)
-{
- if (context->paragraph != nullptr) {
- gint maxLines = context->paragraph->getLineCount() - 1;
- gint firstLine = 0, lastLine = context->height / context->paragraph->getLineHeight();
- GnomeSurface surface(widget);
-
- context->paragraph->draw(&surface, firstLine, (maxLines < lastLine)? maxLines : lastLine);
- }
-
- return true;
-}
-
-GtkWidget *newSample(const gchar *fileName)
-{
- Context *context = new Context();
-
- context->width = 600;
- context->height = 400;
- context->paragraph = Paragraph::paragraphFactory(fileName, font, guiSupport);
-
- gchar *title = prettyTitle(fileName);
- GtkWidget *app = gnome_app_new("gnomeLayout", title);
-
- gtk_object_set_data(GTK_OBJECT(app), "context", context);
-
- gtk_window_set_default_size(GTK_WINDOW(app), 600 - 24, 400);
-
- gnome_app_create_menus_with_data(GNOME_APP(app), mainMenu, app);
-
- gtk_signal_connect(GTK_OBJECT(app), "delete_event",
- GTK_SIGNAL_FUNC(eventDelete), nullptr);
-
- GtkWidget *area = gtk_drawing_area_new();
- gtk_object_set_data(GTK_OBJECT(app), "area", area);
-
- GtkStyle *style = gtk_style_copy(gtk_widget_get_style(area));
-
- for (int i = 0; i < 5; i += 1) {
- style->fg[i] = style->white;
- }
-
- gtk_widget_set_style(area, style);
-
- gnome_app_set_contents(GNOME_APP(app), area);
-
- gtk_signal_connect(GTK_OBJECT(area),
- "expose_event",
- GTK_SIGNAL_FUNC(eventExpose),
- context);
-
- gtk_signal_connect(GTK_OBJECT(area),
- "configure_event",
- GTK_SIGNAL_FUNC(eventConfigure),
- context);
-
- appList = g_slist_prepend(appList, app);
-
- g_free(title);
-
- return app;
-}
-
-void closeSample(GtkWidget *app)
-{
- Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
-
- delete context->paragraph;
-
- delete context;
-
- appList = g_slist_remove(appList, app);
-
- gtk_widget_destroy(app);
-
- if (appList == nullptr) {
- gtk_main_quit();
- }
-}
-
-int main (int argc, char *argv[])
-{
- LEErrorCode fontStatus = LE_NO_ERROR;
- poptContext ptctx;
- GtkWidget *app;
-
- FT_Init_FreeType(&engine);
-
- gnome_init_with_popt_table("gnomelayout", "0.1", argc, argv, nullptr, 0, &ptctx);
-
- guiSupport = new GnomeGUISupport();
- fontMap = new GnomeFontMap(engine, "FontMap.Gnome", 24, guiSupport, fontStatus);
- font = new ScriptCompositeFontInstance(fontMap);
-
- if (LE_FAILURE(fontStatus)) {
- FT_Done_FreeType(engine);
- return 1;
- }
-
- const char *defaultArgs[] = {"Sample.txt", nullptr};
- const char **args = poptGetArgs(ptctx);
-
- if (args == nullptr) {
- args = defaultArgs;
- }
-
- for (int i = 0; args[i] != nullptr; i += 1) {
- app = newSample(args[i]);
-
- gtk_widget_show_all(app);
- }
-
- poptFreeContext(ptctx);
-
- gtk_main();
-
- delete font;
- delete guiSupport;
-
- FT_Done_FreeType(engine);
-
- exit(0);
-}
diff --git a/icu4c/source/samples/layout/gsupport.h b/icu4c/source/samples/layout/gsupport.h
deleted file mode 100644
index 4bb6e6c0300..00000000000
--- a/icu4c/source/samples/layout/gsupport.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __GSUPPORT_H
-#define __GSUPPORT_H
-
-typedef void gs_guiSupport;
-
-void gs_postErrorMessage(gs_guiSupport *guiSupport, const char *message, const char *title);
-
-#endif
diff --git a/icu4c/source/samples/layout/layout.cpp b/icu4c/source/samples/layout/layout.cpp
deleted file mode 100644
index fd576937971..00000000000
--- a/icu4c/source/samples/layout/layout.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Layout.cpp
- *
- * created on: 08/03/2000
- * created by: Eric R. Mader
- */
-
-#include
-#include
-
-#include "paragraph.h"
-
-#include "GDIGUISupport.h"
-#include "GDIFontMap.h"
-#include "UnicodeReader.h"
-#include "ScriptCompositeFontInstance.h"
-
-#include "resource.h"
-
-#define ARRAY_LENGTH(array) (sizeof array / sizeof array[0])
-
-struct Context
-{
- le_int32 width;
- le_int32 height;
- Paragraph *paragraph;
-};
-
-LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
-
-#define APP_NAME "LayoutSample"
-
-TCHAR szAppName[] = TEXT(APP_NAME);
-
-void PrettyTitle(HWND hwnd, char *fileName)
-{
- char title[MAX_PATH + 64];
-
- sprintf(title, "%s - %s", APP_NAME, fileName);
-
- SetWindowTextA(hwnd, title);
-}
-
-void InitParagraph(HWND hwnd, Context *context)
-{
- SCROLLINFO si;
-
- if (context->paragraph != nullptr) {
- // FIXME: does it matter what we put in the ScrollInfo
- // if the window's been minimized?
- if (context->width > 0 && context->height > 0) {
- context->paragraph->breakLines(context->width, context->height);
- }
-
- si.cbSize = sizeof si;
- si.fMask = SIF_RANGE | SIF_PAGE | SIF_DISABLENOSCROLL;
- si.nMin = 0;
- si.nMax = context->paragraph->getLineCount() - 1;
- si.nPage = context->height / context->paragraph->getLineHeight();
- SetScrollInfo(hwnd, SB_VERT, &si, true);
- }
-}
-
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
-{
- HWND hwnd;
- HACCEL hAccel;
- MSG msg;
- WNDCLASS wndclass;
- LEErrorCode status = LE_NO_ERROR;
-
- wndclass.style = CS_HREDRAW | CS_VREDRAW;
- wndclass.lpfnWndProc = WndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = sizeof(LONG);
- wndclass.hInstance = hInstance;
- wndclass.hIcon = LoadIcon(nullptr, IDI_APPLICATION);
- wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
- wndclass.lpszMenuName = szAppName;
- wndclass.lpszClassName = szAppName;
-
- if (!RegisterClass(&wndclass)) {
- MessageBox(nullptr, TEXT("This demo only runs on Windows 2000!"), szAppName, MB_ICONERROR);
-
- return 0;
- }
-
- hAccel = LoadAccelerators(hInstance, szAppName);
-
- hwnd = CreateWindow(szAppName, nullptr,
- WS_OVERLAPPEDWINDOW | WS_VSCROLL,
- CW_USEDEFAULT, CW_USEDEFAULT,
- 600, 400,
- nullptr, nullptr, hInstance, nullptr);
-
- ShowWindow(hwnd, iCmdShow);
- UpdateWindow(hwnd);
-
- while (GetMessage(&msg, nullptr, 0, 0)) {
- if (!TranslateAccelerator(hwnd, hAccel, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
- UnregisterClass(szAppName, hInstance);
- return msg.wParam;
-}
-
-LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- HDC hdc;
- Context *context;
- static le_int32 windowCount = 0;
- static GDIFontMap *fontMap = nullptr;
- static GDISurface *surface = nullptr;
- static GDIGUISupport *guiSupport = new GDIGUISupport();
- static ScriptCompositeFontInstance *font = nullptr;
-
- switch (message) {
- case WM_CREATE:
- {
- LEErrorCode fontStatus = LE_NO_ERROR;
-
- hdc = GetDC(hwnd);
- surface = new GDISurface(hdc);
-
- fontMap = new GDIFontMap(surface, "FontMap.GDI", 24, guiSupport, fontStatus);
- font = new ScriptCompositeFontInstance(fontMap);
-
- if (LE_FAILURE(fontStatus)) {
- ReleaseDC(hwnd, hdc);
- return -1;
- }
-
- context = new Context();
-
- context->width = 600;
- context->height = 400;
-
- context->paragraph = Paragraph::paragraphFactory("Sample.txt", font, guiSupport);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) context);
-
- windowCount += 1;
- ReleaseDC(hwnd, hdc);
-
- PrettyTitle(hwnd, "Sample.txt");
- return 0;
- }
-
- case WM_SIZE:
- {
- context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
- context->width = LOWORD(lParam);
- context->height = HIWORD(lParam);
-
- InitParagraph(hwnd, context);
- return 0;
- }
-
- case WM_VSCROLL:
- {
- SCROLLINFO si;
- le_int32 vertPos;
-
- si.cbSize = sizeof si;
- si.fMask = SIF_ALL;
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- vertPos = si.nPos;
-
- switch (LOWORD(wParam))
- {
- case SB_TOP:
- si.nPos = si.nMin;
- break;
-
- case SB_BOTTOM:
- si.nPos = si.nMax;
- break;
-
- case SB_LINEUP:
- si.nPos -= 1;
- break;
-
- case SB_LINEDOWN:
- si.nPos += 1;
- break;
-
- case SB_PAGEUP:
- si.nPos -= si.nPage;
- break;
-
- case SB_PAGEDOWN:
- si.nPos += si.nPage;
- break;
-
- case SB_THUMBTRACK:
- si.nPos = si.nTrackPos;
- break;
-
- default:
- break;
- }
-
- si.fMask = SIF_POS;
- SetScrollInfo(hwnd, SB_VERT, &si, true);
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- if (context->paragraph != nullptr && si.nPos != vertPos) {
- ScrollWindow(hwnd, 0, context->paragraph->getLineHeight() * (vertPos - si.nPos), nullptr, nullptr);
- UpdateWindow(hwnd);
- }
-
- return 0;
- }
-
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- SCROLLINFO si;
- le_int32 firstLine, lastLine;
-
- hdc = BeginPaint(hwnd, &ps);
- SetBkMode(hdc, TRANSPARENT);
-
- si.cbSize = sizeof si;
- si.fMask = SIF_ALL;
- GetScrollInfo(hwnd, SB_VERT, &si);
-
- firstLine = si.nPos;
-
- context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- if (context->paragraph != nullptr) {
- surface->setHDC(hdc);
-
- // NOTE: si.nPos + si.nPage may include a partial line at the bottom
- // of the window. We need this because scrolling assumes that the
- // partial line has been painted.
- lastLine = min (si.nPos + (le_int32) si.nPage, context->paragraph->getLineCount() - 1);
-
- context->paragraph->draw(surface, firstLine, lastLine);
- }
-
- EndPaint(hwnd, &ps);
- return 0;
- }
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDM_FILE_OPEN:
- {
- OPENFILENAMEA ofn;
- char szFileName[MAX_PATH], szTitleName[MAX_PATH];
- static char szFilter[] = "Text Files (.txt)\0*.txt\0"
- "All Files (*.*)\0*.*\0\0";
-
- ofn.lStructSize = sizeof (OPENFILENAMEA);
- ofn.hwndOwner = hwnd;
- ofn.hInstance = nullptr;
- ofn.lpstrFilter = szFilter;
- ofn.lpstrCustomFilter = nullptr;
- ofn.nMaxCustFilter = 0;
- ofn.nFilterIndex = 0;
- ofn.lpstrFile = szFileName;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrFileTitle = szTitleName;
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrInitialDir = nullptr;
- ofn.lpstrTitle = nullptr;
- ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
- ofn.nFileOffset = 0;
- ofn.nFileExtension = 0;
- ofn.lpstrDefExt = "txt";
- ofn.lCustData = 0L;
- ofn.lpfnHook = nullptr;
- ofn.lpTemplateName = nullptr;
-
- szFileName[0] = '\0';
-
- if (GetOpenFileNameA(&ofn)) {
- hdc = GetDC(hwnd);
- surface->setHDC(hdc);
-
- Paragraph *newParagraph = Paragraph::paragraphFactory(szFileName, font, guiSupport);
-
- if (newParagraph != nullptr) {
- context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- if (context->paragraph != nullptr) {
- delete context->paragraph;
- }
-
- context->paragraph = newParagraph;
- InitParagraph(hwnd, context);
- PrettyTitle(hwnd, szTitleName);
- InvalidateRect(hwnd, nullptr, true);
-
- }
- }
-
- //ReleaseDC(hwnd, hdc);
-
- return 0;
- }
-
- case IDM_FILE_EXIT:
- case IDM_FILE_CLOSE:
- SendMessage(hwnd, WM_CLOSE, 0, 0);
- return 0;
-
- case IDM_HELP_ABOUTLAYOUTSAMPLE:
- MessageBox(hwnd, TEXT("Windows Layout Sample 0.1\n")
- TEXT("Copyright (C) 1998-2005 By International Business Machines Corporation and others.\n")
- TEXT("Author: Eric Mader"),
- szAppName, MB_ICONINFORMATION | MB_OK);
- return 0;
-
- }
- break;
-
-
- case WM_DESTROY:
- {
- context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- if (context != nullptr && context->paragraph != nullptr) {
- delete context->paragraph;
- }
-
- delete context;
-
- if (--windowCount <= 0) {
- delete font;
- delete surface;
-
- PostQuitMessage(0);
- }
-
- return 0;
- }
-
- default:
- return DefWindowProc(hwnd, message, wParam, lParam);
- }
-
- return 0;
-}
diff --git a/icu4c/source/samples/layout/layout.sln b/icu4c/source/samples/layout/layout.sln
deleted file mode 100644
index 7ee452a33b5..00000000000
--- a/icu4c/source/samples/layout/layout.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "layout", "layout.vcxproj", "{497500ED-DE1D-4B20-B529-F41B5A0FBEEB}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Debug|Win32.ActiveCfg = Debug|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Debug|Win32.Build.0 = Debug|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Debug|x64.ActiveCfg = Debug|x64
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Debug|x64.Build.0 = Debug|x64
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Release|Win32.ActiveCfg = Release|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Release|Win32.Build.0 = Release|Win32
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Release|x64.ActiveCfg = Release|x64
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/layout/layout.vcxproj b/icu4c/source/samples/layout/layout.vcxproj
deleted file mode 100644
index 31ac1d942ef..00000000000
--- a/icu4c/source/samples/layout/layout.vcxproj
+++ /dev/null
@@ -1,216 +0,0 @@
-п»ї
-
-
- {497500ED-DE1D-4B20-B529-F41B5A0FBEEB}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
- .\x86\Release/layout.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;..\..\..\include\layout;..\..\common;%(AdditionalIncludeDirectories)
- WINVER=0x0601;_WIN32_WINNT=0x0601;NDEBUG;_CONSOLE;WIN32;UNICODE;_CRT_SECURE_NO_DEPRECATE;LE_USE_CMEMORY;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- true
-
-
- .\x86\Release/layout.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- true
- Default
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- ..\..\..\lib\iculx.lib;..\..\..\lib\icule.lib;..\..\..\lib\icuuc.lib;..\..\..\lib\icuin.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x86\Release/layout.exe
- true
- .\x86\Release/layout.pdb
- Windows
-
-
-
-
-
-
- X64
- .\x64\Release/layout.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;..\..\..\include\layout;..\..\common;%(AdditionalIncludeDirectories)
- NDEBUG;_CONSOLE;WIN64;WIN32;UNICODE;_CRT_SECURE_NO_DEPRECATE;LE_USE_CMEMORY;%(PreprocessorDefinitions)
- true
- MultiThreadedDLL
- true
- true
-
-
- .\x64\Release/layout.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- true
- Default
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- ..\..\..\lib64\iculx.lib;..\..\..\lib64\icule.lib;..\..\..\lib64\icuuc.lib;..\..\..\lib64\icuin.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x64\Release/layout.exe
- true
- .\x64\Release/layout.pdb
- Windows
-
-
- MachineX64
-
-
-
-
- .\x86\Debug/layout.tlb
-
-
- Disabled
- ..\..\..\include;..\..\..\include\layout;..\..\common;%(AdditionalIncludeDirectories)
- WINVER=0x0601;_WIN32_WINNT=0x0601;_DEBUG;WIN32;UNICODE;LE_USE_CMEMORY;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebugDLL
- true
-
-
- .\x86\Debug/layout.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- true
- EditAndContinue
- Default
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- ..\..\..\lib\iculxd.lib;..\..\..\lib\iculed.lib;..\..\..\lib\icuucd.lib;..\..\..\lib\icuind.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x86\Debug/layout.exe
- true
- true
- .\x86\Debug/layout.pdb
- Windows
-
-
-
-
-
-
- X64
- .\x64\Debug/layout.tlb
-
-
- Disabled
- ..\..\..\include;..\..\..\include\layout;..\..\common;%(AdditionalIncludeDirectories)
- _DEBUG;WIN64;WIN32;UNICODE;LE_USE_CMEMORY;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebugDLL
- true
-
-
- .\x64\Debug/layout.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- true
- ProgramDatabase
- Default
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- ..\..\..\lib64\iculxd.lib;..\..\..\lib64\iculed.lib;..\..\..\lib64\icuucd.lib;..\..\..\lib64\icuind.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x64\Debug/layout.exe
- true
- true
- .\x64\Debug/layout.pdb
- Windows
-
-
- MachineX64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/layout/layout.vcxproj.filters b/icu4c/source/samples/layout/layout.vcxproj.filters
deleted file mode 100644
index 4a28bdf48af..00000000000
--- a/icu4c/source/samples/layout/layout.vcxproj.filters
+++ /dev/null
@@ -1,95 +0,0 @@
-п»ї
-
-
-
- {d95d859b-6ae7-4ac2-953c-511411f74b77}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {8e82936c-dd21-49c1-9174-d88411b4b9c7}
- h;hpp;hxx;hm;inl
-
-
- {d7b63b8f-73c9-48ca-b0cb-fa6a537901c4}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/layout/paragraph.cpp b/icu4c/source/samples/layout/paragraph.cpp
deleted file mode 100644
index 5bfc074f92d..00000000000
--- a/icu4c/source/samples/layout/paragraph.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2015, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Paragraph.cpp
- *
- * created on: 09/06/2000
- * created by: Eric R. Mader
- */
-
-#include "unicode/utypes.h"
-#include "unicode/uchar.h"
-#include "unicode/ubidi.h"
-#include "unicode/ustring.h"
-
-#include "layout/ParagraphLayout.h"
-
-#include "RenderingSurface.h"
-
-#include "paragraph.h"
-#include "UnicodeReader.h"
-
-#define MARGIN 10
-#define LINE_GROW 32
-#define PARA_GROW 8
-
-#define CH_LF 0x000A
-#define CH_CR 0x000D
-#define CH_LSEP 0x2028
-#define CH_PSEP 0x2029
-
-static LEUnicode *skipLineEnd(LEUnicode *ptr)
-{
- if (ptr[0] == CH_CR && ptr[1] == CH_LF) {
- ptr += 1;
- }
-
- return ptr + 1;
-}
-
-static le_int32 findRun(const RunArray *runArray, le_int32 offset)
-{
- le_int32 runCount = runArray->getCount();
-
- for (le_int32 run = 0; run < runCount; run += 1) {
- if (runArray->getLimit(run) > offset) {
- return run;
- }
- }
-
- return -1;
-}
-
-static void subsetFontRuns(const FontRuns *fontRuns, le_int32 start, le_int32 limit, FontRuns *sub)
-{
- le_int32 startRun = findRun(fontRuns, start);
- le_int32 endRun = findRun(fontRuns, limit - 1);
-
- sub->reset();
-
- for (le_int32 run = startRun; run <= endRun; run += 1) {
- const LEFontInstance *runFont = fontRuns->getFont(run);
- le_int32 runLimit = fontRuns->getLimit(run) - start;
-
- if (run == endRun) {
- runLimit = limit - start;
- }
-
- sub->add(runFont, runLimit);
- }
-}
-
-Paragraph::Paragraph(const LEUnicode chars[], int32_t charCount, const FontRuns *fontRuns, LEErrorCode &status)
- : fParagraphLayout(nullptr), fParagraphCount(0), fParagraphMax(PARA_GROW), fParagraphGrow(PARA_GROW),
- fLineCount(0), fLinesMax(LINE_GROW), fLinesGrow(LINE_GROW), fLines(nullptr), fChars(nullptr),
- fLineHeight(-1), fAscent(-1), fWidth(-1), fHeight(-1), fParagraphLevel(UBIDI_DEFAULT_LTR)
-{
- static const LEUnicode separators[] = {CH_LF, CH_CR, CH_LSEP, CH_PSEP, 0x0000};
-
- if (LE_FAILURE(status)) {
- return;
- }
-
- le_int32 ascent = 0;
- le_int32 descent = 0;
- le_int32 leading = 0;
-
- LocaleRuns *locales = nullptr;
- FontRuns fr(0);
-
- fLines = LE_NEW_ARRAY(const ParagraphLayout::Line *, fLinesMax);
- fParagraphLayout = LE_NEW_ARRAY(ParagraphLayout *, fParagraphMax);
-
- fChars = LE_NEW_ARRAY(LEUnicode, charCount + 1);
- LE_ARRAY_COPY(fChars, chars, charCount);
- fChars[charCount] = 0;
-
- LEUnicode *pStart = &fChars[0];
-
- while (*pStart != 0) {
- LEUnicode *pEnd = u_strpbrk(pStart, separators);
- le_int32 pAscent, pDescent, pLeading;
- ParagraphLayout *paragraphLayout = nullptr;
-
- if (pEnd == nullptr) {
- pEnd = &fChars[charCount];
- }
-
- if (pEnd != pStart) {
- subsetFontRuns(fontRuns, pStart - fChars, pEnd - fChars, &fr);
-
- paragraphLayout = new ParagraphLayout(pStart, pEnd - pStart, &fr, nullptr, nullptr, locales, fParagraphLevel, false, status);
-
- if (LE_FAILURE(status)) {
- delete paragraphLayout;
- break; // return? something else?
- }
-
- if (fParagraphLevel == UBIDI_DEFAULT_LTR) {
- fParagraphLevel = paragraphLayout->getParagraphLevel();
- }
-
- pAscent = paragraphLayout->getAscent();
- pDescent = paragraphLayout->getDescent();
- pLeading = paragraphLayout->getLeading();
-
- if (pAscent > ascent) {
- ascent = pAscent;
- }
-
- if (pDescent > descent) {
- descent = pDescent;
- }
-
- if (pLeading > leading) {
- leading = pLeading;
- }
- }
-
- if (fParagraphCount >= fParagraphMax) {
- fParagraphLayout = (ParagraphLayout **) LE_GROW_ARRAY(fParagraphLayout, fParagraphMax + fParagraphGrow);
- fParagraphMax += fParagraphGrow;
- }
-
- fParagraphLayout[fParagraphCount++] = paragraphLayout;
-
- if (*pEnd == 0) {
- break;
- }
-
- pStart = skipLineEnd(pEnd);
- }
-
- fLineHeight = ascent + descent + leading;
- fAscent = ascent;
-}
-
-Paragraph::~Paragraph()
-{
- for (le_int32 line = 0; line < fLineCount; line += 1) {
- delete /*(LineInfo *)*/ fLines[line];
- }
-
- for (le_int32 paragraph = 0; paragraph < fParagraphCount; paragraph += 1) {
- delete fParagraphLayout[paragraph];
- }
-
- LE_DELETE_ARRAY(fLines);
- LE_DELETE_ARRAY(fParagraphLayout);
- LE_DELETE_ARRAY(fChars);
-}
-
-void Paragraph::addLine(const ParagraphLayout::Line *line)
-{
- if (fLineCount >= fLinesMax) {
- fLines = (const ParagraphLayout::Line **) LE_GROW_ARRAY(fLines, fLinesMax + fLinesGrow);
- fLinesMax += fLinesGrow;
- }
-
- fLines[fLineCount++] = line;
-}
-
-void Paragraph::breakLines(le_int32 width, le_int32 height)
-{
- fHeight = height;
-
- // don't re-break if the width hasn't changed
- if (fWidth == width) {
- return;
- }
-
- fWidth = width;
-
- float lineWidth = (float) (width - 2 * MARGIN);
- const ParagraphLayout::Line *line;
-
- // Free the old LineInfo's...
- for (le_int32 li = 0; li < fLineCount; li += 1) {
- delete fLines[li];
- }
-
- fLineCount = 0;
-
- for (le_int32 p = 0; p < fParagraphCount; p += 1) {
- ParagraphLayout *paragraphLayout = fParagraphLayout[p];
-
- if (paragraphLayout != nullptr) {
- paragraphLayout->reflow();
- while ((line = paragraphLayout->nextLine(lineWidth)) != nullptr) {
- addLine(line);
- }
- } else {
- addLine(nullptr);
- }
- }
-}
-
-void Paragraph::draw(RenderingSurface *surface, le_int32 firstLine, le_int32 lastLine)
-{
- le_int32 li, x, y;
-
- x = MARGIN;
- y = fAscent;
-
- for (li = firstLine; li <= lastLine; li += 1) {
- const ParagraphLayout::Line *line = fLines[li];
-
- if (line != nullptr) {
- le_int32 runCount = line->countRuns();
- le_int32 run;
-
- if (fParagraphLevel == UBIDI_RTL) {
- le_int32 lastX = line->getWidth();
-
- x = (fWidth - lastX - MARGIN);
- }
-
-
- for (run = 0; run < runCount; run += 1) {
- const ParagraphLayout::VisualRun *visualRun = line->getVisualRun(run);
- le_int32 glyphCount = visualRun->getGlyphCount();
- const LEFontInstance *font = visualRun->getFont();
- const LEGlyphID *glyphs = visualRun->getGlyphs();
- const float *positions = visualRun->getPositions();
-
- surface->drawGlyphs(font, glyphs, glyphCount, positions, x, y, fWidth, fHeight);
- }
- }
-
- y += fLineHeight;
- }
-}
-
-Paragraph *Paragraph::paragraphFactory(const char *fileName, const LEFontInstance *font, GUISupport *guiSupport)
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 charCount;
- const char16_t *text = UnicodeReader::readFile(fileName, guiSupport, charCount);
- Paragraph *result = nullptr;
-
- if (text == nullptr) {
- return nullptr;
- }
-
- FontRuns fontRuns(0);
-
- fontRuns.add(font, charCount);
-
- result = new Paragraph(text, charCount, &fontRuns, status);
-
- if (LE_FAILURE(status)) {
- delete result;
- result = nullptr;
- }
-
- LE_DELETE_ARRAY(text);
-
- return result;
-}
-
diff --git a/icu4c/source/samples/layout/paragraph.h b/icu4c/source/samples/layout/paragraph.h
deleted file mode 100644
index 822c1cfb924..00000000000
--- a/icu4c/source/samples/layout/paragraph.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- *******************************************************************************
- *******************************************************************************
- *
- * Copyright (C) 1999-2007, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- *******************************************************************************
- * file name: Paragraph.h
- *
- * created on: 09/06/2000
- * created by: Eric R. Mader
- */
-#ifndef __PARAGRAPH_H
-#define __PARAGRAPH_H
-
-#include "unicode/utypes.h"
-#include "unicode/ubidi.h"
-
-#include "layout/LEFontInstance.h"
-#include "layout/ParagraphLayout.h"
-
-#include "GUISupport.h"
-#include "RenderingSurface.h"
-
-U_NAMESPACE_USE
-
-#define MARGIN 10
-
-#if 0
-class LineInfo;
-#endif
-
-class Paragraph
-{
-public:
- Paragraph(const LEUnicode chars[], le_int32 charCount, const FontRuns *fontRuns, LEErrorCode &status);
-
- ~Paragraph();
-
- le_int32 getAscent();
- le_int32 getLineHeight();
- le_int32 getLineCount();
- void breakLines(le_int32 width, le_int32 height);
- void draw(RenderingSurface *surface, le_int32 firstLine, le_int32 lastLine);
-
- static Paragraph *paragraphFactory(const char *fileName, const LEFontInstance *font, GUISupport *guiSupport);
-
-private:
- void addLine(const ParagraphLayout::Line *line);
-
- ParagraphLayout **fParagraphLayout;
-
- le_int32 fParagraphCount;
- le_int32 fParagraphMax;
- le_int32 fParagraphGrow;
-
- le_int32 fLineCount;
- le_int32 fLinesMax;
- le_int32 fLinesGrow;
-
- const ParagraphLayout::Line **fLines;
- LEUnicode *fChars;
-
- le_int32 fLineHeight;
- le_int32 fAscent;
- le_int32 fWidth;
- le_int32 fHeight;
- UBiDiLevel fParagraphLevel;
-};
-
-inline le_int32 Paragraph::getLineHeight()
-{
- return fLineHeight;
-}
-
-inline le_int32 Paragraph::getLineCount()
-{
- return fLineCount;
-}
-
-inline le_int32 Paragraph::getAscent()
-{
- return fAscent;
-}
-
-#endif
-
-
diff --git a/icu4c/source/samples/layout/pflow.c b/icu4c/source/samples/layout/pflow.c
deleted file mode 100644
index 52967c234bd..00000000000
--- a/icu4c/source/samples/layout/pflow.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#include
-
-#include "unicode/utypes.h"
-#include "unicode/uchar.h"
-#include "unicode/ubidi.h"
-#include "unicode/ustring.h"
-
-#include "layout/LETypes.h"
-
-#include "layout/loengine.h"
-#include "layout/playout.h"
-#include "layout/plruns.h"
-
-#include "pflow.h"
-
-#include "arraymem.h"
-#include "ucreader.h"
-
-/*
- * Move the line below out of this comment
- * to add a locale run to the pl_paragraphs
- * that are created.
-#define TEST_LOCALE "zh_TW"
- */
-
-#define MARGIN 10
-#define LINE_GROW 32
-#define PARA_GROW 8
-
-#define CH_LF 0x000A
-#define CH_CR 0x000D
-#define CH_LSEP 0x2028
-#define CH_PSEP 0x2029
-
-struct pf_object
-{
- pl_paragraph **fParagraphLayout;
-
- le_int32 fParagraphCount;
- le_int32 fParagraphMax;
- le_int32 fParagraphGrow;
-
- le_int32 fLineCount;
- le_int32 fLinesMax;
- le_int32 fLinesGrow;
-
- pl_line **fLines;
-
- LEUnicode *fChars;
-
- le_int32 fLineHeight;
- le_int32 fAscent;
- le_int32 fWidth;
- le_int32 fHeight;
- UBiDiLevel fParagraphLevel;
-};
-
-typedef struct pf_object pf_object;
-
-
-static LEUnicode *skipLineEnd(LEUnicode *ptr)
-{
- if (ptr[0] == CH_CR && ptr[1] == CH_LF) {
- ptr += 1;
- }
-
- return ptr + 1;
-}
-
-static le_int32 findFontRun(const pl_fontRuns *fontRuns, le_int32 offset)
-{
- le_int32 runCount = pl_getFontRunCount(fontRuns);
- le_int32 run;
-
- for (run = 0; run < runCount; run += 1) {
- if (pl_getFontRunLimit(fontRuns, run) > offset) {
- return run;
- }
- }
-
- return -1;
-}
-
-static void subsetFontRuns(const pl_fontRuns *fontRuns, le_int32 start, le_int32 limit, pl_fontRuns *sub)
-{
- le_int32 startRun = findFontRun(fontRuns, start);
- le_int32 endRun = findFontRun(fontRuns, limit - 1);
- le_int32 run;
-
- pl_resetFontRuns(sub);
-
- for (run = startRun; run <= endRun; run += 1) {
- const le_font *runFont = pl_getFontRunFont(fontRuns, run);
- le_int32 runLimit = pl_getFontRunLimit(fontRuns, run) - start;
-
- if (run == endRun) {
- runLimit = limit - start;
- }
-
- pl_addFontRun(sub, runFont, runLimit);
- }
-}
-
-pf_flow *pf_create(const LEUnicode chars[], le_int32 charCount, const pl_fontRuns *fontRuns, LEErrorCode *status)
-{
- pf_object *flow;
- le_int32 ascent = 0;
- le_int32 descent = 0;
- le_int32 leading = 0;
- pl_localeRuns *locales = NULL;
- pl_fontRuns *fr;
- LEUnicode *pStart;
- static const LEUnicode separators[] = {CH_LF, CH_CR, CH_LSEP, CH_PSEP, 0x0000};
-
- if (LE_FAILURE(*status)) {
- return NULL;
- }
-
- flow = NEW_ARRAY(pf_object, 1);
-
- flow->fParagraphLayout = NULL;
- flow->fParagraphCount = 0;
- flow->fParagraphMax = PARA_GROW;
- flow->fParagraphGrow = PARA_GROW;
- flow->fLineCount = 0;
- flow->fLinesMax = LINE_GROW;
- flow->fLinesGrow = LINE_GROW;
- flow->fLines = NULL;
- flow->fChars = NULL;
- flow->fLineHeight = -1;
- flow->fAscent = -1;
- flow->fWidth = -1;
- flow->fHeight = -1;
- flow->fParagraphLevel = UBIDI_DEFAULT_LTR;
-
- fr = pl_openEmptyFontRuns(0);
-
-#ifdef TEST_LOCALE
- locales = pl_openEmptyLocaleRuns(0);
-#endif
-
- flow->fLines = NEW_ARRAY(pl_line *, flow->fLinesMax);
- flow->fParagraphLayout = NEW_ARRAY(pl_paragraph *, flow->fParagraphMax);
-
- flow->fChars = NEW_ARRAY(LEUnicode, charCount + 1);
- LE_ARRAY_COPY(flow->fChars, chars, charCount);
- flow->fChars[charCount] = 0;
-
- pStart = &flow->fChars[0];
-
- while (*pStart != 0) {
- LEUnicode *pEnd = u_strpbrk(pStart, separators);
- le_int32 pAscent, pDescent, pLeading;
- pl_paragraph *paragraphLayout = NULL;
-
- if (pEnd == NULL) {
- pEnd = &flow->fChars[charCount];
- }
-
- if (pEnd != pStart) {
- subsetFontRuns(fontRuns, pStart - flow->fChars, pEnd - flow->fChars, fr);
-
-#ifdef TEST_LOCALE
- pl_resetLocaleRuns(locales);
- pl_addLocaleRun(locales, TEST_LOCALE, pEnd - pStart);
-#endif
-
- paragraphLayout = pl_create(pStart, pEnd - pStart, fr, NULL, NULL, locales, flow->fParagraphLevel, false, status);
-
- if (LE_FAILURE(*status)) {
- break; /* return? something else? */
- }
-
- if (flow->fParagraphLevel == UBIDI_DEFAULT_LTR) {
- flow->fParagraphLevel = pl_getParagraphLevel(paragraphLayout);
- }
-
- pAscent = pl_getAscent(paragraphLayout);
- pDescent = pl_getDescent(paragraphLayout);
- pLeading = pl_getLeading(paragraphLayout);
-
- if (pAscent > ascent) {
- ascent = pAscent;
- }
-
- if (pDescent > descent) {
- descent = pDescent;
- }
-
- if (pLeading > leading) {
- leading = pLeading;
- }
- }
-
- if (flow->fParagraphCount >= flow->fParagraphMax) {
- flow->fParagraphLayout = (pl_paragraph **) GROW_ARRAY(flow->fParagraphLayout, flow->fParagraphMax + flow->fParagraphGrow);
- flow->fParagraphMax += flow->fParagraphGrow;
- }
-
- flow->fParagraphLayout[flow->fParagraphCount++] = paragraphLayout;
-
- if (*pEnd == 0) {
- break;
- }
-
- pStart = skipLineEnd(pEnd);
- }
-
- flow->fLineHeight = ascent + descent + leading;
- flow->fAscent = ascent;
-
- pl_closeLocaleRuns(locales);
- pl_closeFontRuns(fr);
-
- return (pf_flow *) flow;
-}
-
-void pf_close(pf_flow *flow)
-{
- pf_object *obj = (pf_object *) flow;
- le_int32 i;
-
- for (i = 0; i < obj->fLineCount; i += 1) {
- DELETE_ARRAY(obj->fLines[i]);
- }
-
- DELETE_ARRAY(obj->fLines);
-
- for (i = 0; i < obj->fParagraphCount; i += 1) {
- pl_close(obj->fParagraphLayout[i]);
- }
-
- DELETE_ARRAY(obj->fParagraphLayout);
-
- DELETE_ARRAY(obj->fChars);
-
- DELETE_ARRAY(obj);
-}
-
-
-le_int32 pf_getAscent(pf_flow *flow)
-{
- pf_object *obj = (pf_object *) flow;
-
- return obj->fAscent;
-}
-
-le_int32 pf_getLineHeight(pf_flow *flow)
-{
- pf_object *obj = (pf_object *) flow;
-
- return obj->fLineHeight;
-}
-
-le_int32 pf_getLineCount(pf_flow *flow)
-{
- pf_object *obj = (pf_object *) flow;
-
- return obj->fLineCount;
-}
-
-static void addLine(pf_object *obj, pl_line *line)
-{
- if (obj->fLineCount >= obj->fLinesMax) {
- obj->fLines = (pl_line **) GROW_ARRAY(obj->fLines, obj->fLinesMax + obj->fLinesGrow);
- obj->fLinesMax += obj->fLinesGrow;
- }
-
- obj->fLines[obj->fLineCount++] = line;
-}
-
-void pf_breakLines(pf_flow *flow, le_int32 width, le_int32 height)
-{
- pf_object *obj = (pf_object *) flow;
- le_int32 li, p;
- float lineWidth;
- pl_line *line;
-
- obj->fHeight = height;
-
- /* don't re-break if the width hasn't changed */
- if (obj->fWidth == width) {
- return;
- }
-
- obj->fWidth = width;
-
- lineWidth = (float) (width - 2 * MARGIN);
-
- /* Free the old Lines... */
- for (li = 0; li < obj->fLineCount; li += 1) {
- pl_closeLine(obj->fLines[li]);
- }
-
- obj->fLineCount = 0;
-
- for (p = 0; p < obj->fParagraphCount; p += 1) {
- pl_paragraph *paragraphLayout = obj->fParagraphLayout[p];
-
- if (paragraphLayout != NULL) {
- pl_reflow(paragraphLayout);
- while ((line = pl_nextLine(paragraphLayout, lineWidth)) != NULL) {
- addLine(obj, line);
- }
- } else {
- addLine(obj, NULL);
- }
- }
-}
-
-void pf_draw(pf_flow *flow, rs_surface *surface, le_int32 firstLine, le_int32 lastLine)
-{
- pf_object *obj = (pf_object *) flow;
- le_int32 li, x, y;
-
- x = MARGIN;
- y = obj->fAscent;
-
- for (li = firstLine; li <= lastLine; li += 1) {
- const pl_line *line = obj->fLines[li];
-
- if (line != NULL) {
- le_int32 runCount = pl_countLineRuns(line);
- le_int32 run;
-
- if (obj->fParagraphLevel == UBIDI_RTL) {
- le_int32 lastX = pl_getLineWidth(line);
-
- x = (obj->fWidth - lastX - MARGIN);
- }
-
-
- for (run = 0; run < runCount; run += 1) {
- const pl_visualRun *visualRun = pl_getLineVisualRun(line, run);
- le_int32 glyphCount = pl_getVisualRunGlyphCount(visualRun);
- const le_font *font = pl_getVisualRunFont(visualRun);
- const LEGlyphID *glyphs = pl_getVisualRunGlyphs(visualRun);
- const float *positions = pl_getVisualRunPositions(visualRun);
-
- rs_drawGlyphs(surface, font, glyphs, glyphCount, positions, x, y, obj->fWidth, obj->fHeight);
- }
- }
-
- y += obj->fLineHeight;
- }
-}
-
-pf_flow *pf_factory(const char *fileName, const le_font *font, gs_guiSupport *guiSupport)
-{
- LEErrorCode status = LE_NO_ERROR;
- le_int32 charCount;
- const UChar *text = uc_readFile(fileName, guiSupport, &charCount);
- pl_fontRuns *fontRuns;
- pf_flow *result = NULL;
-
- if (text == NULL) {
- return NULL;
- }
-
- fontRuns = pl_openEmptyFontRuns(0);
-
- pl_addFontRun(fontRuns, font, charCount);
-
- result = pf_create(text, charCount, fontRuns, &status);
-
- if (LE_FAILURE(status)) {
- pf_close(result);
- result = NULL;
- }
-
- pl_closeFontRuns(fontRuns);
-
- DELETE_ARRAY(text);
-
- return result;
-}
-
diff --git a/icu4c/source/samples/layout/pflow.h b/icu4c/source/samples/layout/pflow.h
deleted file mode 100644
index d759a8f4247..00000000000
--- a/icu4c/source/samples/layout/pflow.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __PFLOW_H
-#define __PFLOW_H
-
-#include "unicode/utypes.h"
-#include "layout/LETypes.h"
-
-#include "layout/plruns.h"
-#include "layout/playout.h"
-
-#include "gsupport.h"
-#include "rsurface.h"
-
-typedef void pf_flow;
-
-pf_flow *pf_create(const LEUnicode chars[], le_int32 charCount, const pl_fontRuns *fontRuns, LEErrorCode *status);
-
-void pf_close(pf_flow *flow);
-
-le_int32 pf_getAscent(pf_flow *flow);
-le_int32 pf_getLineHeight(pf_flow *flow);
-le_int32 pf_getLineCount(pf_flow *flow);
-void pf_breakLines(pf_flow *flow, le_int32 width, le_int32 height);
-void pf_draw(pf_flow *flow, rs_surface *surface, le_int32 firstLine, le_int32 lastLine);
-
-pf_flow *pf_factory(const char *fileName, const le_font *font, gs_guiSupport *guiSupport);
-
-#endif
diff --git a/icu4c/source/samples/layout/readme.html b/icu4c/source/samples/layout/readme.html
deleted file mode 100644
index 32c89d8c07a..00000000000
--- a/icu4c/source/samples/layout/readme.html
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-
-
-
-
-
- Readme file for the ICU LayoutEngine demo
-
-
-
- What is the layout demo?
-
- The layout demo displays a paragraph of text that is laid out using the
- LayoutEngine. There are two versions of this demo, "layout.exe" which runs on
- Windows 2000, and "gnomelayout" which runs on Linux. Both programs read a
- file containing the Unicode text to display, and a file that says which font
- to use to display each script.
-
- How do I build the layout demo? First, you need to build ICU,
- including the LayoutEngine.
-
- On Windows, the layout project should be listed as a dependency of all, so
- layout will build when you build all. If it doesn't for some reason, just
- select the layout project in the project toolbar and build it.
-
- On Linux systems, you need to add the "--enable-layout=yes" option when
- you invoke the runConfigureICU script. When you've done that, layout should
- build when you do "make all install"
-
- To build the demo on Windows, just open the layout project in
- <icu>\source\samples\layout and build it.
-
- On Linux systems, connect to <top-build-dir>/samples/layout and do
- "make all". To build the layout demo on Linux, you'll need the
- gnome-libs-devel and freetype-devel packages, which should be part of your
- Linux distribution. The demo uses the FreeType 1 library, and the make files
- assume that the FreeType header files are in /usr/include/freetype1, and that
- the freetype library is /usr/lib/libttf.so. This is how RedHat Linux 7.2
- installs FreeType 1. If your system is different, you may need to add sym
- links to where the files are stored on your system, or modify
- <top-src-dir>/samples/layout/Makefile.in to reference the files
- correctly for your system.
-
- How do I run the demo?
-
- Before you can run the demo, you'll need to get the fonts it uses. For
- legal reasons, we can't include these fonts with ICU, but you can download
- them from the web. To do this, you'll need access to a computer running
- Windows. Here's how to get the fonts:
-
- First, download the Thai font. Go to freelang.net and
- click on the link for the Courier Thai font. This will download a .ZIP file.
- Extract the Courpro.ttf font. On Windows, copy this font file to your
- Fonts folder (note the name of the font after it is installed), on Linux, copy this font file to the directory from which
- you'll run the layout demo.
-
- Next is the Hindi font. Download the font from Raghindi . On Linux, you can download the font into the
- directory from which you'll run the layout demo. On Windows, you'll need to
- install it in your Fonts folder.
-
- There's still one more font to get, the Code2000 Unicode font. Go to James
- Kass' Unicode Support In Your
- Browser page and click on the link that says "Click Here to download
- Code2000 shareware demo Unicode font." This will download a .ZIP file which
- contains CODE2000.TTF and CODE2000.HTM. Expand this .ZIP file. If you're
- going to run the layout demo on Linux, put the CODE2000.TTF file in the
- directory from which you'll run the demo. On Windows, copy the font to your
- fonts folder.
-
- Note: The Code2000 font is shareware. If you want to use
- it for longer than a trial period, you should send a shareware fee to James.
- Directions for how to do this are in CODE2000.HTM.
-
- Be sure that your FontMap.GDI (on Windows) or FontMap.Gnome file (on Linux) contains accurate
- font names for each script type. For example, the following is a valid FontMap.GDI (assuming you have the correct fonts):
- DEVANAGARI: Raghindi THAI: Courier MonoThai DEFAULT: Code2000 Note that only the Code2000 default font is strictly necessary,
- and that the other two can simply be commented out by a '#' if you do not wish to use them.
-
- Also note that the FontMap and the sample.txt files have to be in the same directory as the layout executable.
-
- That's it! Now all you have to do is run letest (CTRL+F5 in Visual C++, or
- "./gnomelayout" in Linux)
-
- How can I customize the layout demo?
-
- The text that the layout demo displays is read from the file "Sample.txt."
- You can change the text by editing this file using a Unicode-aware text
- editor. (it is in UTF8 format with a BOM as the first character; the demo can
- also read UTF16 and UTF32 format files) Remember that the text will be
- displayed in a single paragraph; you can include CR and LF characters in the
- text, but they will be ignored.
-
- If you add scripts to the text other than Arabic, Devanagari, Latin or
- Thai, you'll need to find a font which contains the characters in that
- script, and add an entry to the FontMap file ("FontMap.GDI" on Windows,
- "FontMap.Gnome" on Linux) This file contains a single entry per line. Each
- entry contains a script name followed by a colon, and then a font name.
-
- Here is the list of legal script names:
-
-
- ARABIC
- ARMENIAN
- BENGALI
- BOPOMOFO
- BUHID
- CANADIAN_ABORIGINAL
- CHEROKEE
- CYRILLIC
- DESERET
- DEVANAGARI
- ETHIOPIC
- GEORGIAN
- GOTHIC
- GREEK
- GUJARATI
- GURMUKHI
- HAN
- HANGUL
- HANUNOO
- HEBREW
- HIRAGANA
- KANNADA
- KATAKANA
- KHMER
- LATIN
- MALAYALAM
- MONGOLIAN
- MYANMAR
- OGHAM
- OLD_ITALIC
- ORIYA
- RUNIC
- SINHALA
- SYRIAC
- TAGALOG
- TAGBANWA
- TAMIL
- TELUGU
- THAANA
- THAI
- TIBETAN
- YI
-
-
- You can also use the script name "DEFAULT" to represent all scripts which
- you don't explicitly list in the FontMap file.
-
- On Windows use the full name of the font as it appears in the Windows
- Fonts folder (eg. "Times New Roman") On Linux, use the file name of the font
- file (e.g. "Times.TTF") If you're running on Windows, you'll need to install
- the new fonts in your Fonts folder. If you're running on Linux, put them in
- the directory from which you'll run the demo.
-
-
diff --git a/icu4c/source/samples/layout/resource.h b/icu4c/source/samples/layout/resource.h
deleted file mode 100644
index f4fdeed67ba..00000000000
--- a/icu4c/source/samples/layout/resource.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// В© 2016 and later: Unicode, Inc. and others.
-// License & terms of use: http://www.unicode.org/copyright.html
-// Corporation and others. All Rights Reserved.
-// Copyright (c) 2001-2003 International Business Machines
-// Corporation and others. All Rights Reserved.
-// Used by LayoutSample.rc
-//
-#define IDM_FILE_NEWSAMPLE 40001
-#define IDM_FILE_OPEN 40002
-#define IDM_FILE_CLOSE 40003
-#define IDM_FILE_EXIT 40004
-#define IDM_HELP_ABOUTLAYOUTSAMPLE 40005
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 104
-#define _APS_NEXT_COMMAND_VALUE 40006
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/icu4c/source/samples/layout/rsurface.cpp b/icu4c/source/samples/layout/rsurface.cpp
deleted file mode 100644
index 194613ec59d..00000000000
--- a/icu4c/source/samples/layout/rsurface.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#include "layout/loengine.h"
-#include "rsurface.h"
-
-#include "layout/LETypes.h"
-#include "layout/LEFontInstance.h"
-#include "RenderingSurface.h"
-
-using icu::LEFontInstance;
-
-U_CDECL_BEGIN
-
-void rs_drawGlyphs(rs_surface *surface, const le_font *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height)
-{
- RenderingSurface *rs = (RenderingSurface *) surface;
-
- rs->drawGlyphs((const LEFontInstance *) font, glyphs, count, positions, x, y, width, height);
-}
-
-U_CDECL_END
diff --git a/icu4c/source/samples/layout/rsurface.h b/icu4c/source/samples/layout/rsurface.h
deleted file mode 100644
index f5a01611b84..00000000000
--- a/icu4c/source/samples/layout/rsurface.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __RSURFACE_H
-#define __RSURFACE_H
-
-#include "layout/loengine.h"
-
-typedef void rs_surface;
-
-U_CDECL_BEGIN
-
-void rs_drawGlyphs(rs_surface *surface, const le_font *font, const LEGlyphID *glyphs, le_int32 count,
- const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height);
-
-U_CDECL_END
-
-#endif
diff --git a/icu4c/source/samples/layout/sfnt.h b/icu4c/source/samples/layout/sfnt.h
deleted file mode 100644
index 8de11860577..00000000000
--- a/icu4c/source/samples/layout/sfnt.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- ******************************************************************************
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- ******************************************************************************
- ****************************************************************************** *
- *
- * Copyright (C) 1999-2001, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ****************************************************************************** *
- * file name: sfnt.h
- *
- * created on: ??/??/2001
- * created by: Eric R. Mader
- */
-
-#ifndef __SFNT_H
-#define __SFNT_H
-
-#include "layout/LETypes.h"
-
-
-#ifndef ANY_NUMBER
-#define ANY_NUMBER 1
-#endif
-
-struct DirectoryEntry
-{
- le_uint32 tag;
- le_uint32 checksum;
- le_uint32 offset;
- le_uint32 length;
-};
-
-struct SFNTDirectory
-{
- le_uint32 scalerType;
- le_uint16 numTables;
- le_uint16 searchRange;
- le_uint16 entrySelector;
- le_uint16 rangeShift;
- DirectoryEntry tableDirectory[ANY_NUMBER];
-};
-
-
-struct CMAPEncodingSubtableHeader
-{
- le_uint16 platformID;
- le_uint16 platformSpecificID;
- le_uint32 encodingOffset;
-};
-
-struct CMAPTable
-{
- le_uint16 version;
- le_uint16 numberSubtables;
- CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
-};
-
-struct CMAPEncodingSubtable
-{
- le_uint16 format;
- le_uint16 length;
- le_uint16 language;
-};
-
-struct CMAPFormat0Encoding : CMAPEncodingSubtable
-{
- le_uint8 glyphIndexArray[256];
-};
-
-struct CMAPFormat2Subheader
-{
- le_uint16 firstCode;
- le_uint16 entryCount;
- le_int16 idDelta;
- le_uint16 idRangeOffset;
-};
-
-struct CMAPFormat2Encoding : CMAPEncodingSubtable
-{
- le_uint16 subHeadKeys[256];
- CMAPFormat2Subheader subheaders[ANY_NUMBER];
-};
-
-struct CMAPFormat4Encoding : CMAPEncodingSubtable
-{
- le_uint16 segCountX2;
- le_uint16 searchRange;
- le_uint16 entrySelector;
- le_uint16 rangeShift;
- le_uint16 endCodes[ANY_NUMBER];
-// le_uint16 reservedPad;
-// le_uint16 startCodes[ANY_NUMBER];
-// le_uint16 idDelta[ANY_NUMBER];
-// le_uint16 idRangeOffset[ANY_NUMBER];
-// le_uint16 glyphIndexArray[ANY_NUMBER];
-};
-
-struct CMAPFormat6Encoding : CMAPEncodingSubtable
-{
- le_uint16 firstCode;
- le_uint16 entryCount;
- le_uint16 glyphIndexArray[ANY_NUMBER];
-};
-
-struct CMAPEncodingSubtable32
-{
- le_uint32 format;
- le_uint32 length;
- le_uint32 language;
-};
-
-struct CMAPGroup
-{
- le_uint32 startCharCode;
- le_uint32 endCharCode;
- le_uint32 startGlyphCode;
-};
-
-struct CMAPFormat8Encoding : CMAPEncodingSubtable32
-{
- le_uint32 is32[65536/32];
- le_uint32 nGroups;
- CMAPGroup groups[ANY_NUMBER];
-};
-
-struct CMAPFormat10Encoding : CMAPEncodingSubtable32
-{
- le_uint32 startCharCode;
- le_uint32 numCharCodes;
- le_uint16 glyphs[ANY_NUMBER];
-};
-
-struct CMAPFormat12Encoding : CMAPEncodingSubtable32
-{
- le_uint32 nGroups;
- CMAPGroup groups[ANY_NUMBER];
-};
-
-typedef le_int32 fixed;
-
-struct BigDate
-{
- le_uint32 bc;
- le_uint32 ad;
-};
-
-struct HEADTable
-{
- fixed version;
- fixed fontRevision;
- le_uint32 checksumAdjustment;
- le_uint32 magicNumber;
- le_uint16 flags;
- le_uint16 unitsPerEm;
- BigDate created;
- BigDate modified;
- le_int16 xMin;
- le_int16 yMin;
- le_int16 xMax;
- le_int16 yMax;
- le_int16 lowestRecPPEM;
- le_int16 fontDirectionHint;
- le_int16 indexToLocFormat;
- le_int16 glyphDataFormat;
-};
-
-struct MAXPTable
-{
- fixed version;
- le_uint16 numGlyphs;
- le_uint16 maxPoints;
- le_uint16 maxContours;
- le_uint16 maxComponentPoints;
- le_uint16 maxComponentContours;
- le_uint16 maxZones;
- le_uint16 maxTwilightPoints;
- le_uint16 maxStorage;
- le_uint16 maxFunctionDefs;
- le_uint16 maxInstructionDefs;
- le_uint16 maxStackElements;
- le_uint16 maxSizeOfInstructions;
- le_uint16 maxComponentElements;
- le_uint16 maxComponentDepth;
-};
-
-struct HHEATable
-{
- fixed version;
- le_int16 ascent;
- le_int16 descent;
- le_int16 lineGap;
- le_uint16 advanceWidthMax;
- le_int16 minLeftSideBearing;
- le_int16 minRightSideBearing;
- le_int16 xMaxExtent;
- le_int16 caretSlopeRise;
- le_int16 caretSlopeRun;
- le_int16 caretOffset;
- le_int16 reserved1;
- le_int16 reserved2;
- le_int16 reserved3;
- le_int16 reserved4;
- le_int16 metricDataFormat;
- le_uint16 numOfLongHorMetrics;
-};
-
-struct LongHorMetric
-{
- le_uint16 advanceWidth;
- le_int16 leftSideBearing;
-};
-
-struct HMTXTable
-{
- LongHorMetric hMetrics[ANY_NUMBER]; // ANY_NUMBER = numOfLongHorMetrics from hhea table
-// le_int16 leftSideBearing[ANY_NUMBER]; // ANY_NUMBER = numGlyphs - numOfLongHorMetrics
-};
-
-#endif
-
diff --git a/icu4c/source/samples/layout/ucreader.cpp b/icu4c/source/samples/layout/ucreader.cpp
deleted file mode 100644
index fd0345c6b73..00000000000
--- a/icu4c/source/samples/layout/ucreader.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#include "unicode/utypes.h"
-
-#include "ucreader.h"
-#include "gsupport.h"
-#include "UnicodeReader.h"
-
-U_CDECL_BEGIN
-
-const char16_t *uc_readFile(const char *fileName, gs_guiSupport *guiSupport, int32_t *charCount)
-{
- return UnicodeReader::readFile(fileName, (GUISupport *) guiSupport, *charCount);
-}
-
-U_CDECL_END
diff --git a/icu4c/source/samples/layout/ucreader.h b/icu4c/source/samples/layout/ucreader.h
deleted file mode 100644
index 1f82ecc6193..00000000000
--- a/icu4c/source/samples/layout/ucreader.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
- *
- */
-
-#ifndef __UCREADER_H
-#define __UCREADER_H
-
-#include "unicode/utypes.h"
-#include "gsupport.h"
-
-U_CDECL_BEGIN
-
-const char16_t *uc_readFile(const char *fileName, gs_guiSupport *guiSupport, int32_t *charCount);
-
-U_CDECL_END
-
-#endif
diff --git a/icu4c/source/samples/legacy/Makefile b/icu4c/source/samples/legacy/Makefile
deleted file mode 100644
index f3dfda63dd7..00000000000
--- a/icu4c/source/samples/legacy/Makefile
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2001-2004 IBM, Inc. and others
-# conversion sample code
-
-
-# Usage:
-# - configure and build ICU [see the docs] .. use "--prefix=" something
-# (I used --prefix=/home/srl/III )
-#
-# - do 'make install' of icu
-#
-# - set the variable ICU_PREFIX to point at $(prefix)
-# (will look for $(prefix)/lib/icu/Makefile.inc )
-#
-# - set the variable ICU_LEGACY (read the README)
-# ( Will look for ICU_LEGACY/include/unicode/ucol.h )
-#
-# - do 'make' in this directory
-
-#ICU_PREFIX=/home/weiv/build/current
-#ICU_LEGACY = /home/weiv/build/icu-1-8-1
-
-LEGACY_INCLUDE = $(ICU_LEGACY)/include
-
-ICU_INC=$(ICU_PREFIX)/lib/icu/Makefile.inc
-ICUPATH=
-
--include $(ICU_INC)
-
-# Name of your target
-TARGET=legacy
-
-# All object files (C or C++)
-OBJECTS=legacy.o newcol.o oldcol.o
-
-CLEANFILES=*~ $(TARGET).out
-
-DEPS=$(OBJECTS:.o=.d)
-
-# turn on super warnings
-#CPPFLAGS += -Wall
-
-all: $(TARGET) $(ICU_INC)
-
-.PHONY: all clean distclean check report
-
-oldcol.o : oldcol.cpp $(LEGACY_INCLUDE)/unicode/ucol.h
- $(CXX) -I$(LEGACY_INCLUDE) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c oldcol.cpp
-
-distclean clean:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
- -$(RMV) $(OBJECTS) $(TARGET)
- -$(RMV) $(DEPS)
-
-# Can change this to LINK.c if it is a C only program
-# Can add more libraries here.
-$(TARGET): $(OBJECTS)
- $(LINK.cc) -o $@ $^ $(ICULIBS) $(ICU_PREFIX)/lib/libicuuc.so.18 $(ICU_PREFIX)/lib/libicui18n.so.18
-
-# Make check: simply runs the sample, logged to a file
-check: $(TARGET)
- $(INVOKE) ./$(TARGET) | tee $(TARGET).out
-
-# Make report: creates a 'report file' with both source and sample run
-report: $(TARGET).report
-
-$(TARGET).report: check $(TARGET).cpp
- more $(TARGET).cpp $(TARGET).out > $@
-
-$(ICU_INC):
- @echo ICU_PREFIX variable is not set correctly
- @echo "Please read the directions at the top of this file (Makefile)"
- @echo "And the README"
- @echo "Can't open $(ICU_INC)"
- @false
-
-$(LEGACY_INCLUDE)/unicode/ucol.h:
- @echo ICU_LEGACY variable is not set correctly.
- @echo "Please read the directions at the top of this file (Makefile)"
- @echo "And the README"
- @echo "Can't open $@"
- @false
-
-ifneq ($(MAKECMDGOALS),distclean)
--include $(DEPS)
-endif
diff --git a/icu4c/source/samples/legacy/README b/icu4c/source/samples/legacy/README
deleted file mode 100644
index cecf961e350..00000000000
--- a/icu4c/source/samples/legacy/README
+++ /dev/null
@@ -1,44 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002, International Business Machines Corporation and others. All Rights Reserved.
-This example demonstrates running an instance of ICU 1.8.1. together with a current version of ICU. It only tests u_getVersion and several collation APIs.
-
-Generally, one should be able to simultaneously use one or more versions of ICU 2.0 or higher and one version of ICU 1.8.1 or lower.
-
-What is it all about: Let's say you have a 10 Tb database indexed using ICU 1.8.1. sortkeys. New ICU comes out, with neat new features you would like to use, but also with new sortkeys and you don't care to reindex your 10 Tb database. What to do then??? You can use ICU 1.8.1. in one of your compilation units and current version in all the others. So, you can use old collation until you decide to reindex.
-
-You cannot mix two versions of ICU in the same compilation unit. You cannot automatically use more than one legacy version of ICU.
-
-In order to make the compilation unit use old version of ICU, you have to do a couple of things:
-1) change it's include path so that it includes header files from the old versions
-2) explicitly add old libraries to the linker.
-3) make sure old data can be found (if legacy code needs data).
-
-Building and running of the example:
-
-Linux:
-To make it work, you should build and install both the current ICU and ICU 1.8.1. Put both data libraries to wherever ICU_DATA points (usually it is $(prefix)/share/icu/$(icu_version)/). If data libraries are used, then check for $(prefix)/lib/icu/1.8.1 which should contain libicudata.so and libicudt18*.so
-2. Copy libicuuc.so.18* and libicui18n.so.18* to $(prefix)/lib directory, together with current libraries).
-3. Should work on other Unixes.
-
-
-Change $ICU_PREFIX to point to the current installation, and $ICU_LEGACY to point to 1.8.1 installation. $ICU_LEGACY is needed solely to access the 1.8.1 include directory through $LEGACY_INCLUDE variable, so if you want to move the 1.8.1. include directory, you can set $LEGACY_INCLUDE directly to that directory.
-
-Run make check. You should get two different libraries running at the same time.
-
-Win32:
-Build both current ICU and ICU 1.8.1. Take icuuc18.dll, icuin18.dll and icudt18l.dll and put them somewhere in PATH (a sane place would be wherever current dlls go).
-
-Edit the include directory for oldcol.cpp so that it points to the include directory of ICU 1.8.1.
-Edit the two library entries with path so that they point to .lib files for your version of ICU.
-
-Hit F7, followed by ctrl-F5.
-
-Troubleshooting (all platforms):
-Sample won't compile: this is quite unlikely, but the most probable reason is that include files cannot be found.
-Sample won't link: The path for 1.8.1. libraries is broken. Edit it so that it reflects the path to your libraries.
-Linker says: "Undefined symbol u_getVersion()" (or something similar): path to 1.8.1. libraries is bad.
-Linker says: "Undefined symbol u_getVersion()_X_Y" (or something similar): path to current libraries is bad.
-Legacy crashes horribly: Sorry, didn't put any error checking. If legacy crashes that's most probably because it cannot find the data libraries. You can see which data library is not found by the part of the program that is running. Make sure program can find tha data library either by putting it where ever ICU_DATA points to OR by putting the DLL version of the data library somewhere on your PATH.
-
diff --git a/icu4c/source/samples/legacy/legacy.cpp b/icu4c/source/samples/legacy/legacy.cpp
deleted file mode 100644
index 862080625e3..00000000000
--- a/icu4c/source/samples/legacy/legacy.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* 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
-#include "unicode/utypes.h"
-#include "unicode/ustring.h"
-
-extern "C" void test_current(char16_t data[][5], uint32_t size, uint32_t maxLen, uint8_t keys[][32]);
-extern "C" void test_legacy(char16_t data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]);
-
-void printZTUChar(const char16_t *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 char16_t UArray[][5], int32_t arraySize) {
- fprintf (stdout, "%s\n", comment);
- int32_t i = 0;
- for(i = 0; i
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {57F56795-1802-4605-88A0-013AAE9998F6}
- 8.1
-
-
-
- Application
- false
- MultiByte
- v141
-
-
- Application
- false
- MultiByte
- v141
-
-
- Application
- false
- MultiByte
- v141
-
-
- Application
- false
- MultiByte
- v141
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
- .\x86\Release/legacy.tlb
-
-
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- MultiThreaded
- true
- true
-
-
- .\x86\Release/legacy.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- true
- Default
- stdcpp17
- stdc11
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- icuuc.lib;icuin.lib;../../../../icu-1-8-1/lib/icuuc.lib;../../../../icu-1-8-1/lib/icuin.lib;%(AdditionalDependencies)
- .\x86\Release/legacy.exe
- true
- ../../../lib;%(AdditionalLibraryDirectories)
- .\x86\Release/legacy.pdb
- Console
-
-
-
-
-
-
- X64
- .\x64\Release/legacy.tlb
-
-
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- MultiThreaded
- true
- true
-
-
- .\x64\Release/legacy.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- true
- Default
-
-
- NDEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- icuuc.lib;icuin.lib;../../../../icu-1-8-1/lib/icuuc.lib;../../../../icu-1-8-1/lib/icuin.lib;%(AdditionalDependencies)
- .\x64\Release/legacy.exe
- true
- ../../../lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/legacy.pdb
- Console
-
-
- MachineX64
-
-
-
-
- .\x86\Debug/legacy.tlb
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- WINVER=0x0601;_WIN32_WINNT=0x0601;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebug
- true
-
-
- .\x86\Debug/legacy.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- true
- EditAndContinue
- Default
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- icuucd.lib;icuind.lib;../../../../icu-1-8-1/lib/icuucd.lib;../../../../icu-1-8-1/lib/icuind.lib;%(AdditionalDependencies)
- .\x86\Debug/legacy.exe
- true
- ../../../lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/legacy.pdb
- Console
-
-
-
-
-
-
- X64
- .\x64\Debug/legacy.tlb
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- WINVER=0x0601;_WIN32_WINNT=0x0601;WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebug
- true
-
-
- .\x64\Debug/legacy.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- true
- ProgramDatabase
- Default
-
-
- _DEBUG;%(PreprocessorDefinitions)
- 0x0409
-
-
- icuucd.lib;icuind.lib;../../../../icu-1-8-1/lib/icuucd.lib;../../../../icu-1-8-1/lib/icuind.lib;%(AdditionalDependencies)
- .\x64\Debug/legacy.exe
- true
- ../../../lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/legacy.pdb
- Console
-
-
- MachineX64
-
-
-
-
-
-
- ../../../include;../../../../icu-1-8-1/include
- ../../../include;../../../../icu-1-8-1/include
- ../../../include;../../../../icu-1-8-1/include
- ../../../include;../../../../icu-1-8-1/include
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/legacy/legacy.vcxproj.filters b/icu4c/source/samples/legacy/legacy.vcxproj.filters
deleted file mode 100644
index 6349bbd3ae5..00000000000
--- a/icu4c/source/samples/legacy/legacy.vcxproj.filters
+++ /dev/null
@@ -1,28 +0,0 @@
-п»ї
-
-
-
- {28feb3e5-286e-4bae-8a94-1831f7734250}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {82030ac6-467e-4020-a013-5b05ba72e3c8}
- h;hpp;hxx;hm;inl
-
-
- {f2650fcf-69b6-4d3c-b3ff-8eb4b63775c9}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/legacy/newcol.cpp b/icu4c/source/samples/legacy/newcol.cpp
deleted file mode 100644
index 89dbfd51973..00000000000
--- a/icu4c/source/samples/legacy/newcol.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2001 - 2005, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: newcol.cpp
-* encoding: UTF-8
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2001jul24
-* created by: Vladimir Weinstein
-*/
-
-/******************************************************************************
- * This is the module that uses new collation
- ******************************************************************************/
-
-#include
-#include
-#include "unicode/ucol.h"
-
-// Very simple example code - sticks a sortkey in the buffer
-// Not much error checking
-int32_t getSortKey_current(const char *locale, const char16_t *string, int32_t sLen, uint8_t *buffer, int32_t bLen) {
- UErrorCode status = U_ZERO_ERROR;
- UCollator *coll = ucol_open(locale, &status);
- if(U_FAILURE(status)) {
- return -1;
- }
- int32_t result = ucol_getSortKey(coll, string, sLen, buffer, bLen);
- ucol_close(coll);
- return result;
-}
-
-// This one can be used for passing to qsort function
-// Not thread safe or anything
-static UCollator *compareCollator = nullptr;
-
-int compare_current(const void *string1, const void *string2) {
- if(compareCollator != nullptr) {
- UCollationResult res = ucol_strcoll(compareCollator, (char16_t *) string1, -1, (char16_t *) string2, -1);
- if(res == UCOL_LESS) {
- return -1;
- } else if(res == UCOL_GREATER) {
- return 1;
- } else {
- return 0;
- }
- } else {
- return 0;
- }
-}
-
-void initCollator_current(const char *locale) {
- UErrorCode status = U_ZERO_ERROR;
- compareCollator = ucol_open(locale, &status);
-}
-
-void closeCollator_current() {
- ucol_close(compareCollator);
- compareCollator = nullptr;
-}
-
-
-extern "C" void test_current(char16_t data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]) {
- uint32_t i = 0;
- int32_t keySize = 0;
- UVersionInfo uvi;
-
- u_getVersion(uvi);
- fprintf(stderr, "Entered current, version: [%d.%d.%d.%d]\nMoving to sortkeys\n", uvi[0], uvi[1], uvi[2], uvi[3]);
-
- for(i = 0; i
-#include
-#include
-#include
-
-// Very simple example code - sticks a sortkey in the buffer
-// Not much error checking
-int32_t getSortKey_legacy(const char *locale, const char16_t *string, int32_t sLen, uint8_t *buffer, int32_t bLen) {
- UErrorCode status = U_ZERO_ERROR;
- UCollator *coll = ucol_open(locale, &status);
- if(U_FAILURE(status)) {
- return -1;
- }
- int32_t result = ucol_getSortKey(coll, string, sLen, buffer, bLen);
- ucol_close(coll);
- return result;
-}
-
-// This one can be used for passing to qsort function
-// Not thread safe or anything
-static UCollator *compareCollator = nullptr;
-
-int compare_legacy(const void *string1, const void *string2) {
- if(compareCollator != nullptr) {
- UCollationResult res = ucol_strcoll(compareCollator, (char16_t *) string1, -1, (char16_t *) string2, -1);
- if(res == UCOL_LESS) {
- return -1;
- } else if(res == UCOL_GREATER) {
- return 1;
- } else {
- return 0;
- }
- } else {
- return 0;
- }
-}
-
-void initCollator_legacy(const char *locale) {
- UErrorCode status = U_ZERO_ERROR;
- compareCollator = ucol_open(locale, &status);
-
- if(U_FAILURE(status))
- {
- fprintf(stderr, "initCollator_legacy(%s): error opening collator, %s!\n", locale, u_errorName(status));
- fprintf(stderr, "Note: ICU data directory is %s\n", u_getDataDirectory());
- fprintf(stderr, "Read the README!\n");
- exit(0);
- }
-}
-
-void closeCollator_legacy() {
- if(compareCollator != nullptr)
- {
- ucol_close(compareCollator);
- }
- else
- {
- fprintf(stderr, "closeCollator_legacy(): collator was already nullptr!\n");
- }
- compareCollator = nullptr;
-}
-
-
-extern "C" void test_legacy(char16_t data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[4][32]) {
- uint32_t i = 0;
- int32_t keySize = 0;
-
- UVersionInfo uvi;
-
- u_getVersion(uvi);
- fprintf(stderr, "Entered legacy, version: [%d.%d.%d.%d]\nMoving to sortkeys\n", uvi[0], uvi[1], uvi[2], uvi[3]);
-
- for(i = 0; i argument(s) on .", where n is the number of command line
- arguments (use argc-1), and d is the date (use Calendar::getNow()).
-
- HINT: Your message pattern should have a "number" element and a
- "date" element, and you will need to use Formattable.
-
-Problem 2: ChoiceFormat (Medium)
-
- We can do better than "argument(s)". Instead, we can display more
- idiomatic strings, such as "no arguments", "one argument", "two
- arguments", and for higher values, we can use a number format.
-
- This kind of value-based switching is done using a ChoiceFormat.
- However, you seldom needs to create a ChoiceFormat by itself.
- Instead, most of the time you will supply the ChoiceFormat pattern
- within a MessageFormat pattern.
-
- Use a ChoiceFormat pattern within the MessageFormat pattern, instead
- of the "number" element, to display more idiomatic strings.
-
- EXTRA: Embed a number element within the choice element to handle
- values greater than two.
-
-
-ANSWERS
--------
-
-The exercise includes answers. These are in the "answers" directory,
-and are numbered 1, 2, etc.
-
-If you get stuck and you want to move to the next step, copy the
-answers file into the main directory in order to proceed. E.g.,
-"main_1.cpp" contains the original "main.cpp" file. "main_2.cpp"
-contains the "main.cpp" file after problem 1. Etc.
-
-
-Have fun!
diff --git a/icu4c/source/samples/msgfmt/answers/main_0.cpp b/icu4c/source/samples/msgfmt/answers/main_0.cpp
deleted file mode 100644
index c0b36d7e2db..00000000000
--- a/icu4c/source/samples/msgfmt/answers/main_0.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/msgfmt.h"
-#include "unicode/uclean.h"
-#include
-#include
-#include "util.h"
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
-
- printf("Message: ");
- uprintf(str);
- printf("\n");
-
- u_cleanup();
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/msgfmt/answers/main_1.cpp b/icu4c/source/samples/msgfmt/answers/main_1.cpp
deleted file mode 100644
index bbe7fc70b5b..00000000000
--- a/icu4c/source/samples/msgfmt/answers/main_1.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2002, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/msgfmt.h"
-#include
-#include
-#include "util.h"
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
-
- printf("Message: ");
- uprintf(str);
- printf("\n");
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/msgfmt/answers/main_2.cpp b/icu4c/source/samples/msgfmt/answers/main_2.cpp
deleted file mode 100644
index e8891aa01fc..00000000000
--- a/icu4c/source/samples/msgfmt/answers/main_2.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2002, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/msgfmt.h"
-#include "unicode/calendar.h"
-#include
-#include
-#include "util.h"
-
-// The message format pattern. It takes a single argument, an integer,
-// and formats it as "no", "one", or a number, using a NumberFormat.
-static UnicodeString PATTERN(
- "Received {0,choice,0#no|1#one|1& {0,number,integer}} arguments"
- " on {1,date,long}."
-);
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
- FieldPosition pos;
-
- // Create a message format
- MessageFormat msg(PATTERN, status);
- check(status, "MessageFormat::ct");
-
- // Create the argument list
- Formattable msgArgs[2];
- msgArgs[0].setLong(argc-1);
- msgArgs[1].setDate(Calendar::getNow());
-
- // Format the arguments
- msg.format(msgArgs, 2, str, pos, status);
- check(status, "MessageFormat::format");
-
- printf("Message: ");
- uprintf(str);
- printf("\n");
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/msgfmt/answers/main_3.cpp b/icu4c/source/samples/msgfmt/answers/main_3.cpp
deleted file mode 100644
index d335a7e8307..00000000000
--- a/icu4c/source/samples/msgfmt/answers/main_3.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2002, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/msgfmt.h"
-#include "unicode/calendar.h"
-#include
-#include
-#include "util.h"
-
-// The message format pattern. It takes a single argument, an integer,
-// and formats it as "no", "one", or a number, using a NumberFormat.
-static UnicodeString PATTERN(
- "Received {0,choice,0#no arguments|1#one argument|2#{0,number,integer} arguments}"
- " on {1,date,long}."
-);
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
- FieldPosition pos;
-
- // Create a message format
- MessageFormat msg(PATTERN, status);
- check(status, "MessageFormat::ct");
-
- // Create the argument list
- Formattable msgArgs[2];
- msgArgs[0].setLong(argc-1);
- msgArgs[1].setDate(Calendar::getNow());
-
- // Format the arguments
- msg.format(msgArgs, 2, str, pos, status);
- check(status, "MessageFormat::format");
-
- printf("Message: ");
- uprintf(str);
- printf("\n");
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/msgfmt/main.cpp b/icu4c/source/samples/msgfmt/main.cpp
deleted file mode 100644
index cdcdbbfd1ad..00000000000
--- a/icu4c/source/samples/msgfmt/main.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2003, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/msgfmt.h"
-#include "unicode/calendar.h"
-#include
-#include
-#include "util.h"
-
-// The message format pattern. It takes a single argument, an integer,
-// and formats it as "no", "one", or a number, using a NumberFormat.
-static UnicodeString PATTERN(
- "Received {0,choice,0#no arguments|1#one argument|2#{0,number,integer} arguments}"
- " on {1,date,long}."
-);
-
-int main(int argc, char **argv) {
-
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString str;
- FieldPosition pos;
-
- // Create a message format
- MessageFormat msg(PATTERN, status);
- check(status, "MessageFormat::ct");
-
- // Create the argument list
- Formattable msgArgs[2];
- msgArgs[0].setLong(argc-1);
- msgArgs[1].setDate(Calendar::getNow());
-
- // Format the arguments
- msg.format(msgArgs, 2, str, pos, status);
- check(status, "MessageFormat::format");
-
- printf("Message: ");
- uprintf(str);
- printf("\n");
-
- printf("Exiting successfully\n");
- return 0;
-}
diff --git a/icu4c/source/samples/msgfmt/msgfmt.sln b/icu4c/source/samples/msgfmt/msgfmt.sln
deleted file mode 100644
index f90def09d81..00000000000
--- a/icu4c/source/samples/msgfmt/msgfmt.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msgfmt", "msgfmt.vcxproj", "{5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|Win32.ActiveCfg = Debug|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|Win32.Build.0 = Debug|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|x64.ActiveCfg = Debug|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Debug|x64.Build.0 = Debug|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|Win32.ActiveCfg = Release|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|Win32.Build.0 = Release|Win32
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|x64.ActiveCfg = Release|x64
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/msgfmt/msgfmt.vcxproj b/icu4c/source/samples/msgfmt/msgfmt.vcxproj
deleted file mode 100644
index b1a90405b6c..00000000000
--- a/icu4c/source/samples/msgfmt/msgfmt.vcxproj
+++ /dev/null
@@ -1,155 +0,0 @@
-п»ї
-
-
- {5FF1D1A2-1630-446C-B6EA-93EFD4F975C3}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
- .\x86\Release/msgfmt.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
-
-
- .\x86\Release/msgfmt.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- true
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x86\Release/msgfmt.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Release/msgfmt.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/msgfmt.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
-
-
- .\x64\Release/msgfmt.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x64\Release/msgfmt.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/msgfmt.pdb
- Console
-
-
-
-
-
-
- .\x86\Debug/msgfmt.tlb
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDebugDLL
-
-
- .\x86\Debug/msgfmt.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- true
- EditAndContinue
- Default
-
-
- icuucd.lib;icuind.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x86\Debug/msgfmt.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/msgfmt.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/msgfmt.tlb
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- MultiThreadedDebugDLL
-
-
- .\x64\Debug/msgfmt.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- ProgramDatabase
- Default
-
-
- icuucd.lib;icuind.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x64\Debug/msgfmt.exe
- true
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/msgfmt.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/msgfmt/msgfmt.vcxproj.filters b/icu4c/source/samples/msgfmt/msgfmt.vcxproj.filters
deleted file mode 100644
index 43f6e5d67bc..00000000000
--- a/icu4c/source/samples/msgfmt/msgfmt.vcxproj.filters
+++ /dev/null
@@ -1,25 +0,0 @@
-п»ї
-
-
-
- {ee7c4dbe-02ac-43f8-89cf-260b2bebecc9}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {b140c5d1-fe3d-4fbc-9931-fd1a6a555dc7}
- h;hpp;hxx;hm;inl
-
-
- {66a2f758-b543-469a-a2c9-754e37e23a81}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/msgfmt/util.cpp b/icu4c/source/samples/msgfmt/util.cpp
deleted file mode 100644
index a64836fe962..00000000000
--- a/icu4c/source/samples/msgfmt/util.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2010, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-#include
-#include
-
-using namespace icu;
-
-// Verify that a UErrorCode is successful; exit(1) if not
-void check(UErrorCode& status, const char* msg) {
- if (U_FAILURE(status)) {
- printf("ERROR: %s (%s)\n", u_errorName(status), msg);
- exit(1);
- }
- // printf("Ok: %s\n", msg);
-}
-
-// Append a hex string to the target
-static UnicodeString& appendHex(uint32_t number,
- int8_t digits,
- UnicodeString& target) {
- static const UnicodeString DIGIT_STRING("0123456789ABCDEF");
- while (digits > 0) {
- target += DIGIT_STRING[(number >> ((--digits) * 4)) & 0xF];
- }
- return target;
-}
-
-// Replace nonprintable characters with unicode escapes
-UnicodeString escape(const UnicodeString &source) {
- int32_t i;
- UnicodeString target;
- target += "\"";
- for (i=0; i 0x0A && ch < 0x20) || ch > 0x7E) {
- target += "\\u";
- appendHex(ch, 4, target);
- } else {
- target += ch;
- }
- }
- target += "\"";
- return target;
-}
-
-// Print the given string to stdout
-void uprintf(const UnicodeString &str) {
- char* buf = nullptr;
- int32_t len = str.length();
- // int32_t bufLen = str.extract(0, len, buf); // Preflight
- /* Preflighting seems to be broken now, so assume 1-1 conversion,
- plus some slop. */
- int32_t bufLen = len + 16;
- int32_t actualLen;
- buf = new char[bufLen + 1];
- actualLen = str.extract(0, len, buf/*, bufLen*/); // Default codepage conversion
- buf[actualLen] = 0;
- printf("%s", buf);
- delete [] buf;
-}
diff --git a/icu4c/source/samples/msgfmt/util.h b/icu4c/source/samples/msgfmt/util.h
deleted file mode 100644
index 4b64f5a60c2..00000000000
--- a/icu4c/source/samples/msgfmt/util.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- ***********************************************************************
- ***********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2002, International Business Machines Corporation and
- * others. All Rights Reserved.
- ***********************************************************************/
-
-#include "unicode/unistr.h"
-
-using namespace icu;
-
-// Verify that a UErrorCode is successful; exit(1) if not
-void check(UErrorCode& status, const char* msg);
-
-// Replace nonprintable characters with unicode escapes
-UnicodeString escape(const UnicodeString &source);
-
-// Print the given string to stdout
-void uprintf(const UnicodeString &str);
diff --git a/icu4c/source/samples/numfmt/Makefile b/icu4c/source/samples/numfmt/Makefile
deleted file mode 100644
index 5affb922490..00000000000
--- a/icu4c/source/samples/numfmt/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2002 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=numfmt
-
-# All object files (C or C++)
-OBJECTS=main.o util.o capi.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/numfmt/capi.c b/icu4c/source/samples/numfmt/capi.c
deleted file mode 100644
index 5f833c6c144..00000000000
--- a/icu4c/source/samples/numfmt/capi.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2002, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unum.h"
-#include "unicode/ustring.h"
-#include
-#include
-
-static void uprintf(const UChar* str) {
- char buf[256];
- u_austrcpy(buf, str);
- printf("%s", buf);
-}
-
-void capi() {
- UNumberFormat *fmt;
- UErrorCode status = U_ZERO_ERROR;
- /* The string "987654321.123" as UChars */
- UChar str[] = { 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33,
- 0x32, 0x31, 0x30, 0x2E, 0x31, 0x32, 0x33, 0 };
- UChar buf[256];
- int32_t needed;
- double a;
-
- /* Create a formatter for the US locale */
- fmt = unum_open(
- UNUM_DECIMAL, /* style */
- 0, /* pattern */
- 0, /* patternLength */
- "en_US", /* locale */
- 0, /* parseErr */
- &status);
- if (U_FAILURE(status)) {
- printf("FAIL: unum_open\n");
- exit(1);
- }
-
- /* Use the formatter to parse a number. When using the C API,
- we have to specify whether we want a double or a long in advance.
-
- We pass in NULL for the position pointer in order to get the
- default behavior which is to parse from the start. */
- a = unum_parseDouble(fmt, str, u_strlen(str), NULL, &status);
- if (U_FAILURE(status)) {
- printf("FAIL: unum_parseDouble\n");
- exit(1);
- }
-
- /* Show the result */
- printf("unum_parseDouble(\"");
- uprintf(str);
- printf("\") => %g\n", a);
-
- /* Use the formatter to format the same number back into a string
- in the US locale. The return value is the buffer size needed.
- We're pretty sure we have enough space, but in a production
- application one would check this value.
-
- We pass in NULL for the UFieldPosition pointer because we don't
- care to receive that data. */
- needed = unum_formatDouble(fmt, a, buf, 256, NULL, &status);
- if (U_FAILURE(status)) {
- printf("FAIL: format_parseDouble\n");
- exit(1);
- }
-
- /* Show the result */
- printf("unum_formatDouble(%g) => \"", a);
- uprintf(buf);
- printf("\"\n");
-
- /* Release the storage used by the formatter */
- unum_close(fmt);
-}
diff --git a/icu4c/source/samples/numfmt/main.cpp b/icu4c/source/samples/numfmt/main.cpp
deleted file mode 100644
index ad9df5e6589..00000000000
--- a/icu4c/source/samples/numfmt/main.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2014, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/utypes.h"
-#include "unicode/unistr.h"
-#include "unicode/numfmt.h"
-#include "unicode/dcfmtsym.h"
-#include "unicode/decimfmt.h"
-#include "unicode/locid.h"
-#include "unicode/uclean.h"
-#include "util.h"
-#include
-#include
-#include
-
-extern "C" void capi();
-void cppapi();
-
-static void
-showCurrencyFormatting(UBool useICU26API);
-
-int main(int argc, char **argv) {
- printf("%s output is in UTF-8\n", argv[0]);
-
- printf("C++ API\n");
- cppapi();
-
- printf("C API\n");
- capi();
-
- showCurrencyFormatting(false);
- showCurrencyFormatting(true);
-
- u_cleanup(); // Release any additional storage held by ICU.
-
- printf("Exiting successfully\n");
- return 0;
-}
-
-/**
- * Sample code for the C++ API to NumberFormat.
- */
-void cppapi() {
- Locale us("en", "US");
- UErrorCode status = U_ZERO_ERROR;
-
- // Create a number formatter for the US locale
- NumberFormat *fmt = NumberFormat::createInstance(us, status);
- check(status, "NumberFormat::createInstance");
-
- // Parse a string. The string uses the digits '0' through '9'
- // and the decimal separator '.', standard in the US locale
- UnicodeString str("9876543210.123");
- Formattable result;
- fmt->parse(str, result, status);
- check(status, "NumberFormat::parse");
-
- printf("NumberFormat::parse(\""); // Display the result
- uprintf(str);
- printf("\") => ");
- uprintf(formattableToString(result));
- printf("\n");
-
- // Take the number parsed above, and use the formatter to
- // format it.
- str.remove(); // format() will APPEND to this string
- fmt->format(result, str, status);
- check(status, "NumberFormat::format");
-
- printf("NumberFormat::format("); // Display the result
- uprintf(formattableToString(result));
- printf(") => \"");
- uprintf(str);
- printf("\"\n");
-
- delete fmt; // Release the storage used by the formatter
-
-}
-
-// currency formatting ----------------------------------------------------- ***
-
-/*
- * Set a currency on a NumberFormat with pre-ICU 2.6 APIs.
- * This is a "hack" that will not work properly for all cases because
- * only ICU 2.6 introduced a more complete framework and data for this.
- *
- * @param nf The NumberFormat on which to set the currency; takes effect on
- * currency-formatting NumberFormat instances.
- * This must actually be a DecimalFormat instance.
- * The display style of the output is controlled by nf (its pattern,
- * usually from the display locale ID used to create this instance)
- * while the currency symbol and number of decimals are set for
- * the currency.
- * @param currency The 3-letter ISO 4217 currency code, NUL-terminated.
- * @param errorCode ICU error code, must pass U_SUCCESS() on input.
- */
-static void
-setNumberFormatCurrency_2_4(NumberFormat &nf, const char *currency, UErrorCode &errorCode) {
- // argument checking
- if(U_FAILURE(errorCode)) {
- return;
- }
- if(currency==nullptr || strlen(currency)!=3) {
- errorCode=U_ILLEGAL_ARGUMENT_ERROR;
- return;
- }
-
- // check that the formatter is a DecimalFormat instance
- // necessary because we will cast to the DecimalFormat subclass to set
- // the currency symbol
- DecimalFormat *dnf=dynamic_cast(&nf);
- if(dnf==nullptr) {
- errorCode=U_ILLEGAL_ARGUMENT_ERROR;
- return;
- }
-
- // map the currency code to a locale ID
- // only the currencies in this array are supported
- // it would be possible to map to a locale ID, instantiate a currency
- // formatter for that and copy its values, but that would be slower,
- // and we have to hardcode something here anyway
- static const struct {
- // ISO currency ID
- const char *currency;
-
- // fractionDigits==minimumFractionDigits==maximumFractionDigits
- // for these currencies
- int32_t fractionDigits;
-
- /*
- * Set the rounding increment to 0 if it is implied with the number of
- * fraction digits. Setting an explicit rounding increment makes
- * number formatting slower.
- * In other words, set it to something other than 0 only for unusual
- * cases like "nickel rounding" (0.05) when the increment differs from
- * 10^(-maximumFractionDigits).
- */
- double roundingIncrement;
-
- // Unicode string with the desired currency display symbol or name
- char16_t symbol[16];
- } currencyMap[]={
- { "USD", 2, 0.0, { 0x24, 0 } },
- { "GBP", 2, 0.0, { 0xa3, 0 } },
- { "EUR", 2, 0.0, { 0x20ac, 0 } },
- { "JPY", 0, 0.0, { 0xa5, 0 } }
- };
-
- int32_t i;
-
- for(i=0; isetRoundingIncrement(currencyMap[i].roundingIncrement);
-
- DecimalFormatSymbols symbols(*dnf->getDecimalFormatSymbols());
- symbols.setSymbol(DecimalFormatSymbols::kCurrencySymbol, currencyMap[i].symbol);
- dnf->setDecimalFormatSymbols(symbols); // do not adopt symbols: Jitterbug 2889
-}
-
-/*
- * Set a currency on a NumberFormat with ICU 2.6 APIs.
- *
- * @param nf The NumberFormat on which to set the currency; takes effect on
- * currency-formatting NumberFormat instances.
- * The display style of the output is controlled by nf (its pattern,
- * usually from the display locale ID used to create this instance)
- * while the currency symbol and number of decimals are set for
- * the currency.
- * @param currency The 3-letter ISO 4217 currency code, NUL-terminated.
- * @param errorCode ICU error code, must pass U_SUCCESS() on input.
- */
-static void
-setNumberFormatCurrency_2_6(NumberFormat &nf, const char *currency, UErrorCode &errorCode) {
- if(U_FAILURE(errorCode)) {
- return;
- }
- if(currency==nullptr || strlen(currency)!=3) {
- errorCode=U_ILLEGAL_ARGUMENT_ERROR;
- return;
- }
-
- // invariant-character conversion to UChars (see utypes.h and putil.h)
- char16_t uCurrency[4];
- u_charsToUChars(currency, uCurrency, 4);
-
- // set the currency
- // in ICU 3.0 this API (which was @draft ICU 2.6) gained a UErrorCode& argument
-#if (U_ICU_VERSION_MAJOR_NUM < 3)
- nf.setCurrency(uCurrency);
-#else
- nf.setCurrency(uCurrency, errorCode);
-#endif
-}
-
-static const char *const
-sampleLocaleIDs[]={
- // use locale IDs complete with country code to be sure to
- // pick up number/currency format patterns
- "en_US", "en_GB", "de_DE", "ja_JP", "fr_FR", "hi_IN"
-};
-
-static const char *const
-sampleCurrencies[]={
- "USD", "GBP", "EUR", "JPY"
-};
-
-static void
-showCurrencyFormatting(UBool useICU26API) {
- NumberFormat *nf;
- int32_t i, j;
-
- UnicodeString output;
-
- UErrorCode errorCode;
-
- // TODO: Using printf() here assumes that the runtime encoding is ASCII-friendly
- // and can therefore be mixed with UTF-8
-
- for(i=0; iformat(12345678.93, output);
- output+=(char16_t)0x0a; // '\n'
- uprintf(output);
- }
- }
-}
diff --git a/icu4c/source/samples/numfmt/numfmt.sln b/icu4c/source/samples/numfmt/numfmt.sln
deleted file mode 100644
index f691efd2409..00000000000
--- a/icu4c/source/samples/numfmt/numfmt.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "numfmt", "numfmt.vcxproj", "{721FBD47-E458-4C35-90DA-FF192907D5E2}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|Win32.ActiveCfg = Debug|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|Win32.Build.0 = Debug|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|x64.ActiveCfg = Debug|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Debug|x64.Build.0 = Debug|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|Win32.ActiveCfg = Release|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|Win32.Build.0 = Release|Win32
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|x64.ActiveCfg = Release|x64
- {721FBD47-E458-4C35-90DA-FF192907D5E2}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/numfmt/numfmt.vcxproj b/icu4c/source/samples/numfmt/numfmt.vcxproj
deleted file mode 100644
index 4ea39eb54a7..00000000000
--- a/icu4c/source/samples/numfmt/numfmt.vcxproj
+++ /dev/null
@@ -1,160 +0,0 @@
-п»ї
-
-
- {721FBD47-E458-4C35-90DA-FF192907D5E2}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
-
-
-
- .\x86\Debug/numfmt.tlb
-
-
- ../../../include;%(AdditionalIncludeDirectories)
- MultiThreadedDebugDLL
-
-
- .\x86\Debug/numfmt.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- EditAndContinue
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x86\Debug/numfmt.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/numfmt.pdb
- Console
-
-
-
-
-
-
- X64
- .\x64\Debug/numfmt.tlb
-
-
- Disabled
- ../../../include;%(AdditionalIncludeDirectories)
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- .\x64\Debug/numfmt.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- ProgramDatabase
- Default
-
-
- icuucd.lib;icuind.lib;%(AdditionalDependencies)
- .\x64\Debug/numfmt.exe
- true
- ../../../lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/numfmt.pdb
- Console
-
-
-
-
-
-
- .\x86\Release/numfmt.tlb
-
-
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
-
-
- .\x86\Release/numfmt.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x86\Release/numfmt.exe
- ../../../lib;%(AdditionalLibraryDirectories)
- .\x86\Release/numfmt.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/numfmt.tlb
-
-
- OnlyExplicitInline
- ../../../include;%(AdditionalIncludeDirectories)
- MultiThreadedDLL
- true
-
-
- .\x64\Release/numfmt.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- Default
-
-
- icuuc.lib;icuin.lib;%(AdditionalDependencies)
- .\x64\Release/numfmt.exe
- ../../../lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/numfmt.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/numfmt/numfmt.vcxproj.filters b/icu4c/source/samples/numfmt/numfmt.vcxproj.filters
deleted file mode 100644
index 91ba2a2a12f..00000000000
--- a/icu4c/source/samples/numfmt/numfmt.vcxproj.filters
+++ /dev/null
@@ -1,33 +0,0 @@
-п»ї
-
-
-
- {88ce2f55-7fa8-4f41-8f4b-218bc68250c4}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {d646ea9a-5f23-4c6a-9db6-b028a0f18de5}
- h;hpp;hxx;hm;inl
-
-
- {1fc0ba57-7696-49f7-a631-29ca4759be0e}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Header Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/numfmt/readme.txt b/icu4c/source/samples/numfmt/readme.txt
deleted file mode 100644
index e332f567875..00000000000
--- a/icu4c/source/samples/numfmt/readme.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved.
-numfmt: a sample program which displays number formatting in C and C++
-
-This sample demonstrates
- Formatting a number
- Outputting text in the default codepage to the console
-
-Files:
- main.cpp Main source file in C++
- capi.c C version
- util.cpp formatted output convenience implementation
- util.h formatted output convenience header
- numfmt.sln Windows MSVC workspace. Double-click this to get started.
- numfmt.vcproj Windows MSVC project file
-
-To Build on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\numfmt\numfmt.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the numfmt directory, e.g.
- cd c:\icu\source\samples\numfmt\debug
- 4. Run it
- numfmt
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/numfmt
- gmake ICU_PREFIX=/source/samples/numfmt
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- numfmt
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/numfmt/util.cpp b/icu4c/source/samples/numfmt/util.cpp
deleted file mode 100644
index a231a2fc0ba..00000000000
--- a/icu4c/source/samples/numfmt/util.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2009, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#define __STDC_FORMAT_MACROS 1
-#include
-
-#include "unicode/unistr.h"
-#include "unicode/fmtable.h"
-#include
-#include
-
-using namespace icu;
-
-enum {
- U_SPACE=0x20,
- U_DQUOTE=0x22,
- U_COMMA=0x2c,
- U_LEFT_SQUARE_BRACKET=0x5b,
- U_BACKSLASH=0x5c,
- U_RIGHT_SQUARE_BRACKET=0x5d,
- U_SMALL_U=0x75
-};
-
-// Verify that a UErrorCode is successful; exit(1) if not
-void check(UErrorCode& status, const char* msg) {
- if (U_FAILURE(status)) {
- printf("ERROR: %s (%s)\n", u_errorName(status), msg);
- exit(1);
- }
- // printf("Ok: %s\n", msg);
-}
-
-// Append a hex string to the target
-static UnicodeString& appendHex(uint32_t number,
- int8_t digits,
- UnicodeString& target) {
- uint32_t digit;
- while (digits > 0) {
- digit = (number >> ((--digits) * 4)) & 0xF;
- target += (char16_t)(digit < 10 ? 0x30 + digit : 0x41 - 10 + digit);
- }
- return target;
-}
-
-// Replace nonprintable characters with unicode escapes
-UnicodeString escape(const UnicodeString &source) {
- int32_t i;
- UnicodeString target;
- target += (char16_t)U_DQUOTE;
- for (i=0; i 0x0D && ch < 0x20) || ch > 0x7E) {
- (target += (char16_t)U_BACKSLASH) += (char16_t)U_SMALL_U;
- appendHex(ch, 4, target);
- } else {
- target += ch;
- }
- }
- target += (char16_t)U_DQUOTE;
- return target;
-}
-
-// Print the given string to stdout using the UTF-8 converter
-void uprintf(const UnicodeString &str) {
- char stackBuffer[100];
- char* buf = nullptr;
-
- int32_t bufLen = str.extract(0, 0x7fffffff, stackBuffer, sizeof(stackBuffer), "UTF-8");
- if(bufLen < sizeof(stackBuffer)) {
- buf = stackBuffer;
- } else {
- buf = new char[bufLen + 1];
- bufLen = str.extract(0, 0x7fffffff, buf, bufLen + 1, "UTF-8");
- }
- printf("%s", buf);
- if(buf != stackBuffer) {
- delete[] buf;
- }
-}
-
-// Create a display string for a formattable
-UnicodeString formattableToString(const Formattable& f) {
- switch (f.getType()) {
- case Formattable::kDate:
- // TODO: Finish implementing this
- return UNICODE_STRING_SIMPLE("Formattable_DATE_TBD");
- case Formattable::kDouble:
- {
- char buf[256];
- sprintf(buf, "%gD", f.getDouble());
- return UnicodeString(buf, "");
- }
- case Formattable::kLong:
- {
- char buf[256];
- sprintf(buf, "%" PRId32 "L", f.getLong());
- return UnicodeString(buf, "");
- }
- case Formattable::kInt64:
- {
- char buf[256];
- sprintf(buf, "%" PRId64 "L", f.getInt64());
- return UnicodeString(buf, "");
- }
- case Formattable::kString:
- return UnicodeString((char16_t)U_DQUOTE).append(f.getString()).append((char16_t)U_DQUOTE);
- case Formattable::kArray:
- {
- int32_t i, count;
- const Formattable* array = f.getArray(count);
- UnicodeString result((char16_t)U_LEFT_SQUARE_BRACKET);
- for (i=0; i 0) {
- (result += (char16_t)U_COMMA) += (char16_t)U_SPACE;
- }
- result += formattableToString(array[i]);
- }
- result += (char16_t)U_RIGHT_SQUARE_BRACKET;
- return result;
- }
- default:
- return UNICODE_STRING_SIMPLE("INVALID_Formattable");
- }
-}
diff --git a/icu4c/source/samples/numfmt/util.h b/icu4c/source/samples/numfmt/util.h
deleted file mode 100644
index 86a698cddda..00000000000
--- a/icu4c/source/samples/numfmt/util.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/********************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- *************************************************************************
- *************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2002, International Business Machines Corporation and
- * others. All Rights Reserved.
- *************************************************************************/
-
-#include "unicode/unistr.h"
-#include "unicode/fmtable.h"
-
-using namespace icu;
-
-#ifndef UPRV_LENGTHOF
-#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-#endif
-
-// Verify that a UErrorCode is successful; exit(1) if not
-void check(UErrorCode& status, const char* msg);
-
-// Replace nonprintable characters with unicode escapes
-UnicodeString escape(const UnicodeString &source);
-
-// Print the given string to stdout
-void uprintf(const UnicodeString &str);
-
-// Create a display string for a formattable
-UnicodeString formattableToString(const Formattable& f);
diff --git a/icu4c/source/samples/plurfmtsample/Makefile b/icu4c/source/samples/plurfmtsample/Makefile
deleted file mode 100644
index ef7d7d4ace8..00000000000
--- a/icu4c/source/samples/plurfmtsample/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2006 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=plurfmtsample
-
-# All object files (C or C++)
-OBJECTS=plurfmtsample.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-LDFLAGS += $(LDFLAGS_USTDIO)
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/plurfmtsample/plurfmtsample.cpp b/icu4c/source/samples/plurfmtsample/plurfmtsample.cpp
deleted file mode 100644
index b03e63541d4..00000000000
--- a/icu4c/source/samples/plurfmtsample/plurfmtsample.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/********************************************************************************
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-********************************************************************************
-********************************************************************************
-* Copyright (C) 2008-2013, International Business Machines Corporation and
-* others. All Rights Reserved.
-********************************************************************************
-*/
-
-//! [PluralFormatExample1]
-#include
-#include "unicode/plurfmt.h"
-#include "unicode/msgfmt.h"
-#include "unicode/ustdio.h"
-//! [PluralFormatExample1]
-
-using namespace std;
-using namespace icu;
-
-static void PluralFormatExample() {
-
- u_printf("=============================================================================\n");
- u_printf(" PluralFormatExample()\n");
- u_printf("\n");
- u_printf(" Use PluralFormat and Messageformat to get Plural Form for languages below:\n");
- u_printf(" English, Slovenian\n");
- u_printf("=============================================================================\n");
-
- //! [PluralFormatExample]
- UErrorCode status =U_ZERO_ERROR;
- Locale locEn = Locale("en");
- Locale locSl = Locale("sl");
-
- UnicodeString patEn = UnicodeString("one{dog} other{dogs}"); // English 'dog'
- UnicodeString patSl = UnicodeString("one{pes} two{psa} few{psi} other{psov}"); // Slovenian translation of dog in Plural Form
-
- // Create a new PluralFormat for a given locale locale and pattern string
- PluralFormat plfmtEn = PluralFormat(locEn, patEn,status);
- PluralFormat plfmtSl = PluralFormat(locSl, patSl,status);
- // Constructs a MessageFormat for given pattern and locale.
- MessageFormat* msgfmtEn = new MessageFormat("{0,number} {1}", locEn,status);
- MessageFormat* msgfmtSl = new MessageFormat("{0,number} {1}", locSl,status);
-
- int numbers[] = {0, 1, 2, 3, 4, 5, 10, 100, 101, 102};
- u_printf("Output by using PluralFormat and MessageFormat API\n");
- u_printf("%-16s%-16s%-16s\n","Number", "English","Slovenian");
-
- // Use MessageFormat.format () to format the objects and append to the given StringBuffer
- for (int i=0;iformat(argEn,2,msgEn,fpos,status);
- msgfmtSl->format(argSl,2,msgSl,fpos,status);
- u_printf("%-16d%-16S%-16S\n", numbers[i], msgEn.getTerminatedBuffer(),msgSl.getTerminatedBuffer());
- }
-
- u_printf("\n");
-
- // Equivalent code with message format pattern
- UnicodeString msgPatEn = "{0,plural, one{# dog} other{# dogs}}";
- UnicodeString msgPatSl = "{0,plural, one{# pes} two{# psa} few{# psi} other{# psov}}";
-
- MessageFormat* altMsgfmtEn = new MessageFormat(msgPatEn, locEn,status);
- MessageFormat* altMsgfmtSl = new MessageFormat(msgPatSl, locSl,status);
- u_printf("Same Output by using MessageFormat API only\n");
- u_printf("%-16s%-16s%-16s\n","Number", "English","Slovenian");
- for (int i=0;iformat(arg, 1, msgEn, fPos, status);
- altMsgfmtSl->format(arg, 1, msgSl, fPos,status);
- u_printf("%-16d%-16S%-16S\n", numbers[i], msgEn.getTerminatedBuffer(), msgSl.getTerminatedBuffer());
- }
-
- delete msgfmtEn;
- delete msgfmtSl;
- delete altMsgfmtEn;
- delete altMsgfmtSl;
- //! [PluralFormatExample]
-
- /* output of the sample code:
- ********************************************************************
- Number English Slovenian
- 0 0 dogs 0 psov
- 1 1 dog 1 pes
- 2 2 dogs 2 psa
- 3 3 dogs 3 psi
- 4 4 dogs 4 psi
- 5 5 dogs 5 psov
- 10 10 dogs 10 psov
- 100 100 dogs 100 psov
- 101 101 dogs 101 pes
- 102 102 dogs 102 psa
-
- *********************************************************************/
-}
-int main (int argc, char* argv[])
-{
- PluralFormatExample();
- return 0;
-}
diff --git a/icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj b/icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj
deleted file mode 100644
index c0d3246ae82..00000000000
--- a/icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj
+++ /dev/null
@@ -1,133 +0,0 @@
-п»ї
-
-
- {B500B731-ED1A-4761-94ED-B22DFE25FF2B}
-
-
-
-
-
- Application
- true
- Unicode
-
-
- Application
- true
- Unicode
-
-
- Application
- false
- true
- MultiByte
-
-
- Application
- false
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- .\x86\Debug\
- .\x86\Debug\
- $(ProjectName)
-
-
- .\x64\Debug\
- .\x64\Debug\
- $(ProjectName)
-
-
- .\x86\Release\
- .\x86\Release\
- $(ProjectName)
-
-
- .\x64\Release\
- .\x64\Release\
- $(ProjectName)
-
-
-
- Level3
- Disabled
- ..\..\..\include;%(AdditionalIncludeDirectories)
-
-
- true
- .\x86\Debug\plurfmtsample.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
- Disabled
- ..\..\..\include;%(AdditionalIncludeDirectories)
-
-
- true
- .\x64\Debug\plurfmtsample.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- icuucd.lib;icuind.lib;icuiod.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- ..\..\..\include;%(AdditionalIncludeDirectories)
-
-
- true
- true
- true
- .\x86\Release\plurfmtsample.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- ..\..\..\include;%(AdditionalIncludeDirectories)
-
-
- true
- true
- true
- .\x64\Release\plurfmtsample.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- icuuc.lib;icuin.lib;icuio.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj.filters b/icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj.filters
deleted file mode 100644
index 9089a0411ed..00000000000
--- a/icu4c/source/samples/plurfmtsample/plurfmtsample.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-п»ї
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/props/Makefile b/icu4c/source/samples/props/Makefile
deleted file mode 100644
index e4ed2520e6a..00000000000
--- a/icu4c/source/samples/props/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2002 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-#### definitions
-# Name of your target
-TARGET=props
-
-# All object files (C or C++)
-OBJECTS=props.o
-
-#### rules
-# Load in standard makefile definitions
-include ../defs.mk
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/props/props.cpp b/icu4c/source/samples/props/props.cpp
deleted file mode 100644
index 0f5c4ea390a..00000000000
--- a/icu4c/source/samples/props/props.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2000, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: props.cpp
-* encoding: UTF-8
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2000sep22
-* created by: Markus W. Scherer
-*
-* This file contains sample code that illustrates the use of the ICU APIs
-* for Unicode character properties.
-*/
-
-#define __STDC_FORMAT_MACROS 1
-#include
-
-#include
-#include "unicode/utypes.h"
-#include "unicode/uchar.h"
-#include "unicode/uclean.h"
-
-static void
-printProps(UChar32 codePoint) {
- char buffer[100];
- UErrorCode errorCode;
-
- /* get the character name */
- errorCode=U_ZERO_ERROR;
- u_charName(codePoint, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), &errorCode);
-
- /* print the code point and the character name */
- printf("U+%04" PRId32 "\t%s\n", codePoint, buffer);
-
- /* print some properties */
- printf(" general category (numeric enum value): %u\n", u_charType(codePoint));
-
- /* note: these APIs do not provide the data from SpecialCasing.txt */
- printf(" is lowercase: %d uppercase: U+%04" PRId32 "\n", u_islower(codePoint), u_toupper(codePoint));
-
- printf(" is digit: %d decimal digit value: %d\n", u_isdigit(codePoint), u_charDigitValue(codePoint));
-
- printf(" BiDi directional category (numeric enum value): %u\n", u_charDirection(codePoint));
-}
-
-/* Note: In ICU 2.0, the Unicode class is deprecated - it is a pure wrapper around the C APIs above. */
-
-extern int
-main(int argc, const char *argv[]) {
- static const UChar32
- codePoints[]={
- 0xd, 0x20, 0x2d, 0x35, 0x65, 0x284, 0x665, 0x5678, 0x23456, 0x10317, 0x1D01F, 0x10fffd
- };
- int i;
-
- for(i=0; i
-
-
- {ABE4CD17-8ED8-4DE6-ABDE-CDEFC220CF60}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
-
-
-
- .\x86\Release/props.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- true
- MultiThreadedDebugDLL
- true
- true
-
-
- .\x86\Release/props.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Level3
- true
- Default
-
-
- icuuc.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x86\Release/props.exe
- true
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Release/props.pdb
- Console
-
-
-
-
-
-
- X64
- .\x64\Release/props.tlb
-
-
- OnlyExplicitInline
- ..\..\..\include;%(AdditionalIncludeDirectories)
- true
- MultiThreadedDebugDLL
- true
- true
-
-
- .\x64\Release/props.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Level3
- true
- Default
-
-
- icuuc.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x64\Release/props.exe
- true
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/props.pdb
- Console
-
-
-
-
-
-
-
- .\x86\Debug/props.tlb
-
-
- Disabled
- ..\..\..\include;%(AdditionalIncludeDirectories)
- EnableFastChecks
- MultiThreadedDebugDLL
- true
-
-
- .\x86\Debug/props.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- Level3
- true
- EditAndContinue
- Default
-
-
- icuucd.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x86\Debug/props.exe
- true
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/props.pdb
- Console
-
-
-
-
-
-
- X64
- .\x64\Debug/props.tlb
-
-
- Disabled
- ..\..\..\include;%(AdditionalIncludeDirectories)
- EnableFastChecks
- MultiThreadedDebugDLL
- true
-
-
- .\x64\Debug/props.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- Level3
- true
- ProgramDatabase
- Default
-
-
- icuucd.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- .\x64\Debug/props.exe
- true
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/props.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/props/props.vcxproj.filters b/icu4c/source/samples/props/props.vcxproj.filters
deleted file mode 100644
index f4007503e92..00000000000
--- a/icu4c/source/samples/props/props.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-п»ї
-
-
-
- {2e5ed8fa-dbb6-411e-906e-128c69e6ab1f}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {07db40cb-b9b6-43df-b10e-240fb0d4747b}
- h;hpp;hxx;hm;inl
-
-
- {4526d88f-8075-44ec-8845-dcb0bfbb23fa}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/props/readme.txt b/icu4c/source/samples/props/readme.txt
deleted file mode 100644
index 3a4b32232c1..00000000000
--- a/icu4c/source/samples/props/readme.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved.
-props: Unicode Character Properties
-
-This sample demonstrates
- Using ICU to determine the properties of Unicode characters
-
-
-Files:
- props.cpp Main source file in C++
- props.sln Windows MSVC workspace. Double-click this to get started.
- props.vcproj Windows MSVC project file
-
-To Build props on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\props\props.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the props directory, e.g.
- cd c:\icu\source\samples\props\debug
- 4. Run it
- props
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/props
- gmake ICU_PREFIX=/source/samples/props
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- props
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/readme.txt b/icu4c/source/samples/readme.txt
index 1dfef216d96..d599dddb78d 100644
--- a/icu4c/source/samples/readme.txt
+++ b/icu4c/source/samples/readme.txt
@@ -7,56 +7,14 @@
This directory contains sample code using ICU4C routines. Below is a
short description of the contents of this directory.
-break - demonstrates how to use BreakIterators in C and C++.
-
-cal - prints out a calendar.
-
-case - demonstrates how to do Unicode case conversion in C and C++.
-
coll - shows how collation compares strings
-csdet - demonstrates using ICU's CharSet Detection API
-
-date - prints out the current date, localized.
-
-datecal - demonstrates how a calendar object provides information
-
-datefmt - an exercise using the date formatting API
-
-dtitvfmtsample - shows how date interval format uses predefined skeletons
-
-dtptngsample - uses DateTimePatternGenerator to create customized date/time pattern
-
-layout - demonstrates the ICU LayoutEngine (obsolete)
-
-legacy - demonstrates using two versions of ICU in one application (obsolete)
-
-msgfmt - demonstrates the use of the Message Format
-
-numfmt - demonstrates the use of the number format
-
-plurfmtsample - uses PluralFormat and Messageformat to get Plural Form
-
-props - demonstrates the use of Unicode properties
-
strsrch - demonstrates how to search for patterns in Unicode text using the usearch interface.
translit - demonstrates the use of ICU transliteration
-uciter8 - demonstrates how to leniently read 8-bit Unicode text.
-
-ucnv - demonstrates the use of ICU codepage conversion
-
-udata - demonstrates the use of ICU low level data routines (reader/writer in 'all' MSVC solution)
-
-ufortune - demonstrates packaging and use of resources in an application
-
ugrep - demonstrates ICU Regular Expressions.
-uresb - demonstrates building and loading resource bundles
-
-ustring - demonstrates ICU string manipulation functions
-
==
* Where can I find more sample code?
@@ -86,6 +44,3 @@ ustring - demonstrates ICU string manipulation functions
- type 'make all-samples' from this directory
(other targets: clean-samples, check-samples)
Note: 'make all-samples' won't work correctly in out of source builds.
-
- Note that legacy and layout are obsolete samples that may not compile or run without
- adjustments to their makefiles.
diff --git a/icu4c/source/samples/uciter8/Makefile b/icu4c/source/samples/uciter8/Makefile
deleted file mode 100644
index 6aeb11a0b69..00000000000
--- a/icu4c/source/samples/uciter8/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2003 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-# Name of your target
-TARGET=uciter8
-
-# All object files (C or C++)
-OBJECTS=uciter8.o uit_len8.o
-
-# Load in standard makefile definitions
-include ../defs.mk
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/uciter8/readme.txt b/icu4c/source/samples/uciter8/readme.txt
deleted file mode 100644
index 46e5a6f8264..00000000000
--- a/icu4c/source/samples/uciter8/readme.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (c) 2003-2005, International Business Machines Corporation and others. All Rights Reserved.
-uciter8: Lenient reading of 8-bit Unicode with a UCharIterator
-
-This sample demonstrates reading
-8-bit Unicode text leniently, accepting a mix of UTF-8 and CESU-8
-and also accepting single surrogates.
-UTF-8-style macros are defined as well as a UCharIterator.
-The macros are incomplete (do not assemble code points from pairs of surrogates)
-but sufficient for the iterator.
-
-If you wish to use the lenient-UTF/CESU-8 UCharIterator in a context outside of
-this sample, then copy the uit_len8.c file,
-as well as either the uit_len8.h header or just the prototype that it contains.
-
-*** Warning: ***
-This UCharIterator reads an arbitrary mix of UTF-8 and CESU-8 text.
-It does not conform to any one Unicode charset specification,
-and its use may lead to security risks.
-
-
-Files:
- uciter8.c Main source file in C
- uit_len8.c Lenient-UTF/CESU-8 UCharIterator implementation
- uit_len8.h Header file with the prototoype for the lenient-UTF/CESU-8 UCharIterator
- uciter8.sln Windows MSVC workspace. Double-click this to get started.
- uciter8.vcproj Windows MSVC project file
-
-To Build uciter8 on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\uciter8\uciter8.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the uciter8 directory, e.g.
- cd c:\icu\source\samples\uciter8\debug
- 4. Run it
- uciter8
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Compile
- cd /source/samples/uciter8
- gmake ICU_PREFIX=/source/samples/uciter8
-
- gmake ICU_PREFIX= check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- uciter8
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
diff --git a/icu4c/source/samples/uciter8/uciter8.c b/icu4c/source/samples/uciter8/uciter8.c
deleted file mode 100644
index aa828dbbb54..00000000000
--- a/icu4c/source/samples/uciter8/uciter8.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2003-2014, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: uciter8.c
-* encoding: UTF-8
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2003jan10
-* created by: Markus W. Scherer
-*
-* This file contains sample code that illustrates reading
-* 8-bit Unicode text leniently, accepting a mix of UTF-8 and CESU-8
-* and also accepting single surrogates.
-*/
-
-#include
-#include
-#include "unicode/utypes.h"
-#include "unicode/uiter.h"
-#include "uit_len8.h"
-
-#ifndef UPRV_LENGTHOF
-#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-#endif
-
-#define log_err printf
-
-/* UCharIterator test ------------------------------------------------------- */
-
-/*
- * The following code is a copy of the UCharIterator test code in
- * source/test/cintltst/custrtst.c,
- * testing the lenient-8 iterator instead of the UTF-8 one.
- */
-
-/*
- * Compare results from two iterators, should be same.
- * Assume that the text is not empty and that
- * iteration start==0 and iteration limit==length.
- */
-static void
-compareIterators(UCharIterator *iter1, const char *n1,
- UCharIterator *iter2, const char *n2) {
- int32_t i, pos1, pos2, middle, length;
- UChar32 c1, c2;
-
- /* compare lengths */
- length=iter1->getIndex(iter1, UITER_LENGTH);
- pos2=iter2->getIndex(iter2, UITER_LENGTH);
- if(length!=pos2) {
- log_err("%s->getIndex(length)=%d != %d=%s->getIndex(length)\n", n1, length, pos2, n2);
- return;
- }
-
- /* set into the middle */
- middle=length/2;
-
- pos1=iter1->move(iter1, middle, UITER_ZERO);
- if(pos1!=middle) {
- log_err("%s->move(from 0 to middle %d)=%d does not move to the middle\n", n1, middle, pos1);
- return;
- }
-
- pos2=iter2->move(iter2, middle, UITER_ZERO);
- if(pos2!=middle) {
- log_err("%s->move(from 0 to middle %d)=%d does not move to the middle\n", n2, middle, pos2);
- return;
- }
-
- /* test current() */
- c1=iter1->current(iter1);
- c2=iter2->current(iter2);
- if(c1!=c2) {
- log_err("%s->current()=U+%04x != U+%04x=%s->current() at middle=%d\n", n1, c1, c2, n2, middle);
- return;
- }
-
- /* move forward 3 UChars */
- for(i=0; i<3; ++i) {
- c1=iter1->next(iter1);
- c2=iter2->next(iter2);
- if(c1!=c2) {
- log_err("%s->next()=U+%04x != U+%04x=%s->next() at %d (started in middle)\n", n1, c1, c2, n2, iter1->getIndex(iter1, UITER_CURRENT));
- return;
- }
- }
-
- /* move backward 5 UChars */
- for(i=0; i<5; ++i) {
- c1=iter1->previous(iter1);
- c2=iter2->previous(iter2);
- if(c1!=c2) {
- log_err("%s->previous()=U+%04x != U+%04x=%s->previous() at %d (started in middle)\n", n1, c1, c2, n2, iter1->getIndex(iter1, UITER_CURRENT));
- return;
- }
- }
-
- /* iterate forward from the beginning */
- pos1=iter1->move(iter1, 0, UITER_START);
- if(pos1<0) {
- log_err("%s->move(start) failed\n", n1);
- return;
- }
- if(!iter1->hasNext(iter1)) {
- log_err("%s->hasNext() at the start returns false\n", n1);
- return;
- }
-
- pos2=iter2->move(iter2, 0, UITER_START);
- if(pos2<0) {
- log_err("%s->move(start) failed\n", n2);
- return;
- }
- if(!iter2->hasNext(iter2)) {
- log_err("%s->hasNext() at the start returns false\n", n2);
- return;
- }
-
- do {
- c1=iter1->next(iter1);
- c2=iter2->next(iter2);
- if(c1!=c2) {
- log_err("%s->next()=U+%04x != U+%04x=%s->next() at %d\n", n1, c1, c2, n2, iter1->getIndex(iter1, UITER_CURRENT));
- return;
- }
- } while(c1>=0);
-
- if(iter1->hasNext(iter1)) {
- log_err("%s->hasNext() at the end returns true\n", n1);
- return;
- }
- if(iter2->hasNext(iter2)) {
- log_err("%s->hasNext() at the end returns true\n", n2);
- return;
- }
-
- /* back to the middle */
- pos1=iter1->move(iter1, middle, UITER_ZERO);
- if(pos1!=middle) {
- log_err("%s->move(from end to middle %d)=%d does not move to the middle\n", n1, middle, pos1);
- return;
- }
-
- pos2=iter2->move(iter2, middle, UITER_ZERO);
- if(pos2!=middle) {
- log_err("%s->move(from end to middle %d)=%d does not move to the middle\n", n2, middle, pos2);
- return;
- }
-
- /* move to index 1 */
- pos1=iter1->move(iter1, 1, UITER_ZERO);
- if(pos1!=1) {
- log_err("%s->move(from middle %d to 1)=%d does not move to 1\n", n1, middle, pos1);
- return;
- }
-
- pos2=iter2->move(iter2, 1, UITER_ZERO);
- if(pos2!=1) {
- log_err("%s->move(from middle %d to 1)=%d does not move to 1\n", n2, middle, pos2);
- return;
- }
-
- /* iterate backward from the end */
- pos1=iter1->move(iter1, 0, UITER_LIMIT);
- if(pos1<0) {
- log_err("%s->move(limit) failed\n", n1);
- return;
- }
- if(!iter1->hasPrevious(iter1)) {
- log_err("%s->hasPrevious() at the end returns false\n", n1);
- return;
- }
-
- pos2=iter2->move(iter2, 0, UITER_LIMIT);
- if(pos2<0) {
- log_err("%s->move(limit) failed\n", n2);
- return;
- }
- if(!iter2->hasPrevious(iter2)) {
- log_err("%s->hasPrevious() at the end returns false\n", n2);
- return;
- }
-
- do {
- c1=iter1->previous(iter1);
- c2=iter2->previous(iter2);
- if(c1!=c2) {
- log_err("%s->previous()=U+%04x != U+%04x=%s->previous() at %d\n", n1, c1, c2, n2, iter1->getIndex(iter1, UITER_CURRENT));
- return;
- }
- } while(c1>=0);
-
- if(iter1->hasPrevious(iter1)) {
- log_err("%s->hasPrevious() at the start returns true\n", n1);
- return;
- }
- if(iter2->hasPrevious(iter2)) {
- log_err("%s->hasPrevious() at the start returns true\n", n2);
- return;
- }
-}
-
-/*
- * Test the iterator's getState() and setState() functions.
- * iter1 and iter2 must be set up for the same iterator type and the same string
- * but may be physically different structs (different addresses).
- *
- * Assume that the text is not empty and that
- * iteration start==0 and iteration limit==length.
- * It must be 2<=middle<=length-2.
- */
-static void
-testIteratorState(UCharIterator *iter1, UCharIterator *iter2, const char *n, int32_t middle) {
- UChar32 u[4];
-
- UErrorCode errorCode;
- UChar32 c;
- uint32_t state;
- int32_t i, j;
-
- /* get four UChars from the middle of the string */
- iter1->move(iter1, middle-2, UITER_ZERO);
- for(i=0; i<4; ++i) {
- c=iter1->next(iter1);
- if(c<0) {
- /* the test violates the assumptions, see comment above */
- log_err("test error: %s[%d]=%d\n", n, middle-2+i, c);
- return;
- }
- u[i]=c;
- }
-
- /* move to the middle and get the state */
- iter1->move(iter1, -2, UITER_CURRENT);
- state=uiter_getState(iter1);
-
- /* set the state into the second iterator and compare the results */
- errorCode=U_ZERO_ERROR;
- uiter_setState(iter2, state, &errorCode);
- if(U_FAILURE(errorCode)) {
- log_err("%s->setState(0x%x) failed: %s\n", n, state, u_errorName(errorCode));
- return;
- }
-
- c=iter2->current(iter2);
- if(c!=u[2]) {
- log_err("%s->current(at %d)=U+%04x!=U+%04x\n", n, middle, c, u[2]);
- }
-
- c=iter2->previous(iter2);
- if(c!=u[1]) {
- log_err("%s->previous(at %d)=U+%04x!=U+%04x\n", n, middle-1, c, u[1]);
- }
-
- iter2->move(iter2, 2, UITER_CURRENT);
- c=iter2->next(iter2);
- if(c!=u[3]) {
- log_err("%s->next(at %d)=U+%04x!=U+%04x\n", n, middle+1, c, u[3]);
- }
-
- iter2->move(iter2, -3, UITER_CURRENT);
- c=iter2->previous(iter2);
- if(c!=u[0]) {
- log_err("%s->previous(at %d)=U+%04x!=U+%04x\n", n, middle-2, c, u[0]);
- }
-
- /* move the second iterator back to the middle */
- iter2->move(iter2, 1, UITER_CURRENT);
- iter2->next(iter2);
-
- /* check that both are in the middle */
- i=iter1->getIndex(iter1, UITER_CURRENT);
- j=iter2->getIndex(iter2, UITER_CURRENT);
- if(i!=middle) {
- log_err("%s->getIndex(current)=%d!=%d as expected\n", n, i, middle);
- }
- if(i!=j) {
- log_err("%s->getIndex(current)=%d!=%d after setState()\n", n, j, i);
- }
-
- /* compare lengths */
- i=iter1->getIndex(iter1, UITER_LENGTH);
- j=iter2->getIndex(iter2, UITER_LENGTH);
- if(i!=j) {
- log_err("%s->getIndex(length)=%d!=%d before/after setState()\n", n, i, j);
- }
-}
-
-static void
-TestLenient8Iterator() {
- static const UChar text[]={
- 0x61, 0x62, 0x63,
- /* dffd 107fd d801 dffd - in UTF-16, U+107fd= */
- 0xdffd, 0xd801, 0xdffd, 0xd801, 0xdffd,
- 0x78, 0x79, 0x7a, 0
- };
- static const uint8_t bytes[]={
- 0x61, 0x62, 0x63,
- /* dffd 107fd d801 dffd - mixture */
- 0xed, 0xbf, 0xbd, 0xf0, 0x90, 0x9f, 0xbd, 0xed, 0xa0, 0x81, 0xed, 0xbf, 0xbd,
- 0x78, 0x79, 0x7a, 0
- };
-
- UCharIterator iter1, iter2;
- UChar32 c1, c2;
- int32_t length;
-
- puts("test a UCharIterator for lenient 8-bit Unicode (accept single surrogates)");
-
- /* compare the same string between UTF-16 and lenient-8 UCharIterators */
- uiter_setString(&iter1, text, -1);
- uiter_setLenient8(&iter2, (const char *)bytes, sizeof(bytes)-1);
- compareIterators(&iter1, "UTF16Iterator", &iter2, "Lenient8Iterator");
-
- /* try again with length=-1 */
- uiter_setLenient8(&iter2, (const char *)bytes, -1);
- compareIterators(&iter1, "UTF16Iterator", &iter2, "Lenient8Iterator_1");
-
- /* test get/set state */
- length=UPRV_LENGTHOF(text)-1;
- uiter_setLenient8(&iter1, (const char*)bytes, -1);
- testIteratorState(&iter1, &iter2, "Lenient8IteratorState", length/2);
- testIteratorState(&iter1, &iter2, "Lenient8IteratorStatePlus1", length/2+1);
-
- /* ---------------------------------------------------------------------- */
-
- puts("no output so far means that the lenient-8 iterator works fine");
-
- puts("iterate forward:\nUTF-16\tlenient-8");
- uiter_setString(&iter1, text, -1);
- iter1.move(&iter1, 0, UITER_START);
- iter2.move(&iter2, 0, UITER_START);
- for(;;) {
- c1=iter1.next(&iter1);
- c2=iter2.next(&iter2);
- if(c1<0 && c2<0) {
- break;
- }
- if(c1<0) {
- printf("\t%04x\n", c2);
- } else if(c2<0) {
- printf("%04x\n", c1);
- } else {
- printf("%04x\t%04x\n", c1, c2);
- }
- }
-}
-
-extern int
-main(int argc, const char *argv[]) {
- TestLenient8Iterator();
- return 0;
-}
diff --git a/icu4c/source/samples/uciter8/uciter8.sln b/icu4c/source/samples/uciter8/uciter8.sln
deleted file mode 100644
index 8fe98ffb349..00000000000
--- a/icu4c/source/samples/uciter8/uciter8.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uciter8", "uciter8.vcxproj", "{94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|Win32.ActiveCfg = Debug|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|Win32.Build.0 = Debug|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|x64.ActiveCfg = Debug|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Debug|x64.Build.0 = Debug|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|Win32.ActiveCfg = Release|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|Win32.Build.0 = Release|Win32
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|x64.ActiveCfg = Release|x64
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/uciter8/uciter8.vcxproj b/icu4c/source/samples/uciter8/uciter8.vcxproj
deleted file mode 100644
index fdbfa44d380..00000000000
--- a/icu4c/source/samples/uciter8/uciter8.vcxproj
+++ /dev/null
@@ -1,154 +0,0 @@
-п»ї
-
-
- {94379DD9-E6CC-47AC-8E62-0A4ABD8EB121}
-
-
- Application
- false
- MultiByte
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- .\x86\Debug\
- .\x86\Debug\
- true
- .\x64\Debug\
- .\x64\Debug\
- true
- .\x86\Release\
- .\x86\Release\
- false
- .\x64\Release\
- .\x64\Release\
- false
-
-
-
-
- ..\..\..\include;%(AdditionalIncludeDirectories)
- Level3
-
-
-
-
- .\x86\Debug/uciter8.tlb
-
-
- MultiThreadedDebugDLL
-
-
- .\x86\Debug/uciter8.pch
- .\x86\Debug/
- .\x86\Debug/
- .\x86\Debug/
- EditAndContinue
- Default
-
-
- icuucd.lib;%(AdditionalDependencies)
- .\x86\Debug/uciter8.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- true
- .\x86\Debug/uciter8.pdb
- Console
-
-
-
-
-
-
- .\x64\Debug/uciter8.tlb
-
-
- MultiThreadedDebugDLL
-
-
- .\x64\Debug/uciter8.pch
- .\x64\Debug/
- .\x64\Debug/
- .\x64\Debug/
- ProgramDatabase
- Default
-
-
- icuucd.lib;%(AdditionalDependencies)
- .\x64\Debug/uciter8.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- true
- .\x64\Debug/uciter8.pdb
- Console
-
-
-
-
-
-
- .\x86\Release/uciter8.tlb
-
-
- OnlyExplicitInline
- MultiThreadedDLL
- true
-
-
- .\x86\Release/uciter8.pch
- .\x86\Release/
- .\x86\Release/
- .\x86\Release/
- Default
-
-
- icuuc.lib;%(AdditionalDependencies)
- .\x86\Release/uciter8.exe
- ..\..\..\lib;%(AdditionalLibraryDirectories)
- .\x86\Release/uciter8.pdb
- Console
-
-
-
-
-
-
- .\x64\Release/uciter8.tlb
-
-
- OnlyExplicitInline
- MultiThreadedDLL
- true
-
-
- .\x64\Release/uciter8.pch
- .\x64\Release/
- .\x64\Release/
- .\x64\Release/
- Default
-
-
- icuuc.lib;%(AdditionalDependencies)
- .\x64\Release/uciter8.exe
- ..\..\..\lib64;%(AdditionalLibraryDirectories)
- .\x64\Release/uciter8.pdb
- Console
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/uciter8/uciter8.vcxproj.filters b/icu4c/source/samples/uciter8/uciter8.vcxproj.filters
deleted file mode 100644
index d9b14f9601b..00000000000
--- a/icu4c/source/samples/uciter8/uciter8.vcxproj.filters
+++ /dev/null
@@ -1,30 +0,0 @@
-п»ї
-
-
-
- {539093c3-5b8d-4243-9153-abe14e9601b8}
- cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-
-
- {a04b6e49-ecbb-408f-a73c-9797cf0d45ae}
- h;hpp;hxx;hm;inl
-
-
- {b1a5a5b9-75a4-4bd6-8283-9eba59b3489d}
- ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Header Files
-
-
-
\ No newline at end of file
diff --git a/icu4c/source/samples/uciter8/uit_len8.c b/icu4c/source/samples/uciter8/uit_len8.c
deleted file mode 100644
index d2d3c54af37..00000000000
--- a/icu4c/source/samples/uciter8/uit_len8.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2003-2006, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: uit_len8.c
-* encoding: UTF-8
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2003feb10
-* created by: Markus W. Scherer
-*
-* This file contains the implementation of the "lenient UTF-8" UCharIterator
-* as used in the uciter8 sample code.
-* UTF-8-style macros are defined as well as the UCharIterator.
-* The macros are incomplete (do not assemble code points from pairs of
-* surrogates, see comment below)
-* but sufficient for the iterator.
-*/
-
-#include
-#include "unicode/utypes.h"
-#include "unicode/uiter.h"
-
-/* lenient UTF-8/CESU-8 macros ---------------------------------------------- */
-
-/*
- * This code leniently reads 8-bit Unicode strings,
- * which could contain a mix of UTF-8 and CESU-8.
- * More precisely:
- * - supplementary code points may be encoded with dedicated 4-byte sequences
- * (UTF-8 style)
- * - supplementary code points may be encoded with
- * pairs of 3-byte sequences, one for each surrogate of the UTF-16 form
- * (CESU-8 style)
- * - single surrogates are allowed, encoded with their "natural" 3-byte sequences
- *
- * Limitation:
- * Right now, the macros do not attempt to assemble code points from pairs of
- * separately encoded surrogates.
- * This would not be sufficient for processing based on these macros,
- * but it is sufficient for a UCharIterator that returns only UChars anyway.
- *
- * The code is copied and modified from utf_impl.c and utf8.h.
- *
- * Change 2006feb08: Much of the implementation code is replaced by calling
- * the utf_impl.c functions which accept a new "strict" parameter value
- * of -2 implementing exactly this leniency.
- */
-
-#define L8_NEXT(s, i, length, c) { \
- (c)=(uint8_t)(s)[(i)++]; \
- if((c)>=0x80) { \
- if(U8_IS_LEAD(c)) { \
- (c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (int32_t)(length), c, -2); \
- } else { \
- (c)=U_SENTINEL; \
- } \
- } \
-}
-
-#define L8_PREV(s, start, i, c) { \
- (c)=(uint8_t)(s)[--(i)]; \
- if((c)>=0x80) { \
- if((c)<=0xbf) { \
- (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -2); \
- } else { \
- (c)=U_SENTINEL; \
- } \
- } \
-}
-
-/* lenient-8 UCharIterator -------------------------------------------------- */
-
-/*
- * This is a copy of the UTF-8 UCharIterator in uiter.cpp,
- * except that it uses the lenient-8-bit-Unicode macros above.
- */
-
-/*
- * Minimal implementation:
- * Maintain a single-UChar buffer for an additional surrogate.
- * The caller must not modify start and limit because they are used internally.
- *
- * Use UCharIterator fields as follows:
- * context pointer to UTF-8 string
- * length UTF-16 length of the string; -1 until lazy evaluation
- * start current UTF-8 index
- * index current UTF-16 index; may be -1="unknown" after setState()
- * limit UTF-8 length of the string
- * reservedField supplementary code point
- *
- * Since UCharIterator delivers 16-bit code units, the iteration can be
- * currently in the middle of the byte sequence for a supplementary code point.
- * In this case, reservedField will contain that code point and start will
- * point to after the corresponding byte sequence. The UTF-16 index will be
- * one less than what it would otherwise be corresponding to the UTF-8 index.
- * Otherwise, reservedField will be 0.
- */
-
-/*
- * Possible optimization for NUL-terminated UTF-8 and UTF-16 strings:
- * Add implementations that do not call strlen() for iteration but check for NUL.
- */
-
-static int32_t U_CALLCONV
-lenient8IteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin) {
- switch(origin) {
- case UITER_ZERO:
- case UITER_START:
- return 0;
- case UITER_CURRENT:
- if(iter->index<0) {
- /* the current UTF-16 index is unknown after setState(), count from the beginning */
- const uint8_t *s;
- UChar32 c;
- int32_t i, limit, index;
-
- s=(const uint8_t *)iter->context;
- i=index=0;
- limit=iter->start; /* count up to the UTF-8 index */
- while(istart=i; /* just in case setState() did not get us to a code point boundary */
- if(i==iter->limit) {
- iter->length=index; /* in case it was <0 or wrong */
- }
- if(iter->reservedField!=0) {
- --index; /* we are in the middle of a supplementary code point */
- }
- iter->index=index;
- }
- return iter->index;
- case UITER_LIMIT:
- case UITER_LENGTH:
- if(iter->length<0) {
- const uint8_t *s;
- UChar32 c;
- int32_t i, limit, length;
-
- s=(const uint8_t *)iter->context;
- if(iter->index<0) {
- /*
- * the current UTF-16 index is unknown after setState(),
- * we must first count from the beginning to here
- */
- i=length=0;
- limit=iter->start;
-
- /* count from the beginning to the current index */
- while(istart, set the UTF-16 index */
- iter->start=i; /* just in case setState() did not get us to a code point boundary */
- iter->index= iter->reservedField!=0 ? length-1 : length;
- } else {
- i=iter->start;
- length=iter->index;
- if(iter->reservedField!=0) {
- ++length;
- }
- }
-
- /* count from the current index to the end */
- limit=iter->limit;
- while(ilength=length;
- }
- return iter->length;
- default:
- /* not a valid origin */
- /* Should never get here! */
- return -1;
- }
-}
-
-static int32_t U_CALLCONV
-lenient8IteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin) {
- const uint8_t *s;
- UChar32 c;
- int32_t pos; /* requested UTF-16 index */
- int32_t i; /* UTF-8 index */
- UBool havePos;
-
- /* calculate the requested UTF-16 index */
- switch(origin) {
- case UITER_ZERO:
- case UITER_START:
- pos=delta;
- havePos=true;
- /* iter->index<0 (unknown) is possible */
- break;
- case UITER_CURRENT:
- if(iter->index>=0) {
- pos=iter->index+delta;
- havePos=true;
- } else {
- /* the current UTF-16 index is unknown after setState(), use only delta */
- pos=0;
- havePos=false;
- }
- break;
- case UITER_LIMIT:
- case UITER_LENGTH:
- if(iter->length>=0) {
- pos=iter->length+delta;
- havePos=true;
- } else {
- /* pin to the end, avoid counting the length */
- iter->index=-1;
- iter->start=iter->limit;
- iter->reservedField=0;
- if(delta>=0) {
- return UITER_UNKNOWN_INDEX;
- } else {
- /* the current UTF-16 index is unknown, use only delta */
- pos=0;
- havePos=false;
- }
- }
- break;
- default:
- return -1; /* Error */
- }
-
- if(havePos) {
- /* shortcuts: pinning to the edges of the string */
- if(pos<=0) {
- iter->index=iter->start=iter->reservedField=0;
- return 0;
- } else if(iter->length>=0 && pos>=iter->length) {
- iter->index=iter->length;
- iter->start=iter->limit;
- iter->reservedField=0;
- return iter->index;
- }
-
- /* minimize the number of L8_NEXT/PREV operations */
- if(iter->index<0 || posindex/2) {
- /* go forward from the start instead of backward from the current index */
- iter->index=iter->start=iter->reservedField=0;
- } else if(iter->length>=0 && (iter->length-pos)<(pos-iter->index)) {
- /*
- * if we have the UTF-16 index and length and the new position is
- * closer to the end than the current index,
- * then go backward from the end instead of forward from the current index
- */
- iter->index=iter->length;
- iter->start=iter->limit;
- iter->reservedField=0;
- }
-
- delta=pos-iter->index;
- if(delta==0) {
- return iter->index; /* nothing to do */
- }
- } else {
- /* move relative to unknown UTF-16 index */
- if(delta==0) {
- return UITER_UNKNOWN_INDEX; /* nothing to do */
- } else if(-delta>=iter->start) {
- /* moving backwards by more UChars than there are UTF-8 bytes, pin to 0 */
- iter->index=iter->start=iter->reservedField=0;
- return 0;
- } else if(delta>=(iter->limit-iter->start)) {
- /* moving forward by more UChars than the remaining UTF-8 bytes, pin to the end */
- iter->index=iter->length; /* may or may not be <0 (unknown) */
- iter->start=iter->limit;
- iter->reservedField=0;
- return iter->index>=0 ? iter->index : UITER_UNKNOWN_INDEX;
- }
- }
-
- /* delta!=0 */
-
- /* move towards the requested position, pin to the edges of the string */
- s=(const uint8_t *)iter->context;
- pos=iter->index; /* could be <0 (unknown) */
- i=iter->start;
- if(delta>0) {
- /* go forward */
- int32_t limit=iter->limit;
- if(iter->reservedField!=0) {
- iter->reservedField=0;
- ++pos;
- --delta;
- }
- while(delta>0 && i=2) {
- pos+=2;
- delta-=2;
- } else /* delta==1 */ {
- /* stop in the middle of a supplementary code point */
- iter->reservedField=c;
- ++pos;
- break; /* delta=0; */
- }
- }
- if(i==limit) {
- if(iter->length<0 && iter->index>=0) {
- iter->length= iter->reservedField==0 ? pos : pos+1;
- } else if(iter->index<0 && iter->length>=0) {
- iter->index= iter->reservedField==0 ? iter->length : iter->length-1;
- }
- }
- } else /* delta<0 */ {
- /* go backward */
- if(iter->reservedField!=0) {
- iter->reservedField=0;
- i-=4; /* we stayed behind the supplementary code point; go before it now */
- --pos;
- ++delta;
- }
- while(delta<0 && i>0) {
- L8_PREV(s, 0, i, c);
- if(c<0xffff) {
- --pos;
- ++delta;
- } else if(delta<=-2) {
- pos-=2;
- delta+=2;
- } else /* delta==-1 */ {
- /* stop in the middle of a supplementary code point */
- i+=4; /* back to behind this supplementary code point for consistent state */
- iter->reservedField=c;
- --pos;
- break; /* delta=0; */
- }
- }
- }
-
- iter->start=i;
- if(iter->index>=0) {
- return iter->index=pos;
- } else {
- /* we started with index<0 (unknown) so pos is bogus */
- if(i<=1) {
- return iter->index=i; /* reached the beginning */
- } else {
- /* we still don't know the UTF-16 index */
- return UITER_UNKNOWN_INDEX;
- }
- }
-}
-
-static UBool U_CALLCONV
-lenient8IteratorHasNext(UCharIterator *iter) {
- return iter->reservedField!=0 || iter->startlimit;
-}
-
-static UBool U_CALLCONV
-lenient8IteratorHasPrevious(UCharIterator *iter) {
- return iter->start>0;
-}
-
-static UChar32 U_CALLCONV
-lenient8IteratorCurrent(UCharIterator *iter) {
- if(iter->reservedField!=0) {
- return U16_TRAIL(iter->reservedField);
- } else if(iter->startlimit) {
- const uint8_t *s=(const uint8_t *)iter->context;
- UChar32 c;
- int32_t i=iter->start;
-
- L8_NEXT(s, i, iter->limit, c);
- if(c<0) {
- return 0xfffd;
- } else if(c<=0xffff) {
- return c;
- } else {
- return U16_LEAD(c);
- }
- } else {
- return U_SENTINEL;
- }
-}
-
-static UChar32 U_CALLCONV
-lenient8IteratorNext(UCharIterator *iter) {
- int32_t index;
-
- if(iter->reservedField!=0) {
- UChar trail=U16_TRAIL(iter->reservedField);
- iter->reservedField=0;
- if((index=iter->index)>=0) {
- iter->index=index+1;
- }
- return trail;
- } else if(iter->startlimit) {
- const uint8_t *s=(const uint8_t *)iter->context;
- UChar32 c;
-
- L8_NEXT(s, iter->start, iter->limit, c);
- if((index=iter->index)>=0) {
- iter->index=++index;
- if(iter->length<0 && iter->start==iter->limit) {
- iter->length= c<=0xffff ? index : index+1;
- }
- } else if(iter->start==iter->limit && iter->length>=0) {
- iter->index= c<=0xffff ? iter->length : iter->length-1;
- }
- if(c<0) {
- return 0xfffd;
- } else if(c<=0xffff) {
- return c;
- } else {
- iter->reservedField=c;
- return U16_LEAD(c);
- }
- } else {
- return U_SENTINEL;
- }
-}
-
-static UChar32 U_CALLCONV
-lenient8IteratorPrevious(UCharIterator *iter) {
- int32_t index;
-
- if(iter->reservedField!=0) {
- UChar lead=U16_LEAD(iter->reservedField);
- iter->reservedField=0;
- iter->start-=4; /* we stayed behind the supplementary code point; go before it now */
- if((index=iter->index)>0) {
- iter->index=index-1;
- }
- return lead;
- } else if(iter->start>0) {
- const uint8_t *s=(const uint8_t *)iter->context;
- UChar32 c;
-
- L8_PREV(s, 0, iter->start, c);
- if((index=iter->index)>0) {
- iter->index=index-1;
- } else if(iter->start<=1) {
- iter->index= c<=0xffff ? iter->start : iter->start+1;
- }
- if(c<0) {
- return 0xfffd;
- } else if(c<=0xffff) {
- return c;
- } else {
- iter->start+=4; /* back to behind this supplementary code point for consistent state */
- iter->reservedField=c;
- return U16_TRAIL(c);
- }
- } else {
- return U_SENTINEL;
- }
-}
-
-static uint32_t U_CALLCONV
-lenient8IteratorGetState(const UCharIterator *iter) {
- uint32_t state=(uint32_t)(iter->start<<1);
- if(iter->reservedField!=0) {
- state|=1;
- }
- return state;
-}
-
-static void U_CALLCONV
-lenient8IteratorSetState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode) {
- if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
- /* do nothing */
- } else if(iter==NULL) {
- *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
- } else if(state==lenient8IteratorGetState(iter)) {
- /* setting to the current state: no-op */
- } else {
- int32_t index=(int32_t)(state>>1); /* UTF-8 index */
- state&=1; /* 1 if in surrogate pair, must be index>=4 */
-
- if((state==0 ? index<0 : index<4) || iter->limitstart=index; /* restore UTF-8 byte index */
- if(index<=1) {
- iter->index=index;
- } else {
- iter->index=-1; /* unknown UTF-16 index */
- }
- if(state==0) {
- iter->reservedField=0;
- } else {
- /* verified index>=4 above */
- UChar32 c;
- L8_PREV((const uint8_t *)iter->context, 0, index, c);
- if(c<=0xffff) {
- *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
- } else {
- iter->reservedField=c;
- }
- }
- }
- }
-}
-
-static const UCharIterator lenient8Iterator={
- 0, 0, 0, 0, 0, 0,
- lenient8IteratorGetIndex,
- lenient8IteratorMove,
- lenient8IteratorHasNext,
- lenient8IteratorHasPrevious,
- lenient8IteratorCurrent,
- lenient8IteratorNext,
- lenient8IteratorPrevious,
- NULL,
- lenient8IteratorGetState,
- lenient8IteratorSetState
-};
-
-U_CAPI void U_EXPORT2
-uiter_setLenient8(UCharIterator *iter, const char *s, int32_t length) {
- if(iter!=0) {
- if(s!=0 && length>=-1) {
- *iter=lenient8Iterator;
- iter->context=s;
- if(length>=0) {
- iter->limit=length;
- } else {
- iter->limit=(int32_t)strlen(s);
- }
- iter->length= iter->limit<=1 ? iter->limit : -1;
- } else {
- /* set no-op iterator */
- uiter_setString(iter, NULL, 0);
- }
- }
-}
diff --git a/icu4c/source/samples/uciter8/uit_len8.h b/icu4c/source/samples/uciter8/uit_len8.h
deleted file mode 100644
index bda4265e6a1..00000000000
--- a/icu4c/source/samples/uciter8/uit_len8.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-*******************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-*******************************************************************************
-*******************************************************************************
-*
-* Copyright (C) 2003, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-*******************************************************************************
-* file name: uit_len8.h
-* encoding: UTF-8
-* tab size: 8 (not used)
-* indentation:4
-*
-* created on: 2003feb10
-* created by: Markus W. Scherer
-*
-* This file contains the declaration for a "lenient UTF-8" UCharIterator
-* as used in the uciter8 sample code.
-*/
-
-#ifndef __UIT_LEN8_H__
-#define __UIT_LEN8_H__
-
-#include "unicode/utypes.h"
-#include "unicode/uiter.h"
-
-U_CAPI void U_EXPORT2
-uiter_setLenient8(UCharIterator *iter, const char *s, int32_t length);
-
-#endif
diff --git a/icu4c/source/samples/ucnv/Makefile b/icu4c/source/samples/ucnv/Makefile
deleted file mode 100644
index b97363ff4a3..00000000000
--- a/icu4c/source/samples/ucnv/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2016 and later: Unicode, Inc. and others.
-# License & terms of use: http://www.unicode.org/copyright.html
-#
-# Copyright (c) 2000-2002 IBM, Inc. and others
-# sample code makefile
-
-# Usage:
-# - configure, build, install ICU (make install)
-# - make sure "icu-config" (in the ICU installed bin directory) is on
-# the path
-# - do 'make' in this directory
-
-# Name of your target
-TARGET=convsamp
-
-# All object files (C or C++)
-OBJECTS=convsamp.o flagcb.o
-
-# Load in standard makefile definitions
-include ../defs.mk
-
-# extra files to clean up
-CLEANFILES += *.out data40.utf16 data41.utf16
-
-# the actual rules (this is a simple sample)
-include ../rules.mk
diff --git a/icu4c/source/samples/ucnv/convsamp.cpp b/icu4c/source/samples/ucnv/convsamp.cpp
deleted file mode 100644
index 45a6876180e..00000000000
--- a/icu4c/source/samples/ucnv/convsamp.cpp
+++ /dev/null
@@ -1,1144 +0,0 @@
-/*************************************************************************
-*
-* В© 2016 and later: Unicode, Inc. and others.
-* License & terms of use: http://www.unicode.org/copyright.html
-*
-**************************************************************************
-**************************************************************************
-*
-* Copyright (C) 2000-2016, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-***************************************************************************
-* file name: convsamp.c
-* encoding: ASCII (7-bit)
-*
-* created on: 2000may30
-* created by: Steven R. Loomis
-*
-* Sample code for the ICU conversion routines.
-*
-* Note: Nothing special is needed to build this sample. Link with
-* the icu UC and icu I18N libraries.
-*
-* I use 'assert' for error checking, you probably will want
-* something more flexible. '***BEGIN SAMPLE***' and
-* '***END SAMPLE***' mark pieces suitable for stand alone
-* code snippets.
-*
-*
-* Each test can define it's own BUFFERSIZE
-*
-*/
-
-#define DEBUG_TMI 0 /* define to 1 to enable Too Much Information */
-
-#include
-#include /* for isspace, etc. */
-#include
-#include
-#include /* malloc */
-
-#include "unicode/utypes.h" /* Basic ICU data types */
-#include "unicode/ucnv.h" /* C Converter API */
-#include "unicode/ustring.h" /* some more string fcns*/
-#include "unicode/uchar.h" /* char names */
-#include "unicode/uloc.h"
-#include "unicode/unistr.h"
-
-#include "flagcb.h"
-
-/* Some utility functions */
-#ifndef UPRV_LENGTHOF
-#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-#endif
-
-static const char16_t kNone[] = { 0x0000 };
-
-#define U_ASSERT(x) { if(U_FAILURE(x)) {fflush(stdout);fflush(stderr); fprintf(stderr, #x " == %s\n", u_errorName(x)); assert(U_SUCCESS(x)); }}
-
-/* Print a char16_t if possible, in seven characters. */
-void prettyPrintUChar(char16_t c)
-{
- if( (c <= 0x007F) &&
- (isgraph(c)) ) {
- printf(" '%c' ", (char)(0x00FF&c));
- } else if ( c > 0x007F ) {
- char buf[1000];
- UErrorCode status = U_ZERO_ERROR;
- int32_t o;
-
- o = u_charName(c, U_EXTENDED_CHAR_NAME, buf, 1000, &status);
- if(U_SUCCESS(status) && (o>0) ) {
- buf[6] = 0;
- printf("%7s", buf);
- } else {
- printf(" ??????");
- }
- } else {
- switch((char)(c & 0x007F)) {
- case ' ':
- printf(" ' ' ");
- break;
- case '\t':
- printf(" \\t ");
- break;
- case '\n':
- printf(" \\n ");
- break;
- default:
- printf(" _ ");
- break;
- }
- }
-}
-
-
-void printUChars(const char *name = "?",
- const char16_t *uch = kNone,
- int32_t len = -1 )
-{
- int32_t i;
-
- if( (len == -1) && (uch) ) {
- len = u_strlen(uch);
- }
-
- printf("%5s: ", name);
- for( i = 0; i (strlen(uch));
- }
-
- printf("%5s: ", name);
- for( i = 0; i 0xFFFF) {
- printf("ch: U+%06X\n", ch32);
- }
- else {
- char16_t ch = (char16_t)ch32;
- printUChars("C", &ch, 1);
- }
-}
-
-/*******************************************************************
- Very simple C sample to convert the word 'Moscow' in Russian in Unicode,
- followed by an exclamation mark (!) into the KOI8-R Russian code page.
-
- This example first creates a char16_t String out of the Unicode chars.
-
- targetSize must be set to the amount of space available in the target
- buffer. After fromUChars is called,
- len will contain the number of bytes in target[] which were
- used in the resulting codepage. In this case, there is a 1:1 mapping
- between the input and output characters. The exclamation mark has the
- same value in both KOI8-R and Unicode.
-
- src: 0 1 2 3 4 5 6
- uni: \u041C \u043E \u0441 \u043A \u0432 \u0430 \u0021
- ch: CYRILL CYRILL CYRILL CYRILL CYRILL CYRILL '!'
-
- targ: 0 1 2 3 4 5 6
- uni: \xED \xCF \xD3 \xCB \xD7 \xC1 \x21
- ch: '!'
-
-
-Converting FROM unicode
- to koi8-r.
- You must call ucnv_close to clean up the memory used by the
- converter.
-
- 'len' returns the number of OUTPUT bytes resulting from the
- conversion.
- */
-
-UErrorCode convsample_02()
-{
- printf("\n\n==============================================\n"
- "Sample 02: C: simple Unicode -> koi8-r conversion\n");
-
-
- // **************************** START SAMPLE *******************
- // "catOK"
- char16_t source[] = { 0x041C, 0x043E, 0x0441, 0x043A, 0x0432,
- 0x0430, 0x0021, 0x0000 };
- char target[100];
- UErrorCode status = U_ZERO_ERROR;
- UConverter *conv;
- int32_t len;
-
- // set up the converter
- //! [ucnv_open]
- conv = ucnv_open("koi8-r", &status);
- //! [ucnv_open]
- assert(U_SUCCESS(status));
-
- // convert to koi8-r
- len = ucnv_fromUChars(conv, target, 100, source, -1, &status);
- assert(U_SUCCESS(status));
-
- // close the converter
- ucnv_close(conv);
-
- // ***************************** END SAMPLE ********************
-
- // Print it out
- printUChars("src", source);
- printf("\n");
- printBytes("targ", target, len);
-
- return U_ZERO_ERROR;
-}
-
-
-UErrorCode convsample_03()
-{
- printf("\n\n==============================================\n"
- "Sample 03: C: print out all converters\n");
-
- int32_t count;
- int32_t i;
-
- // **************************** START SAMPLE *******************
- count = ucnv_countAvailable();
- printf("Available converters: %d\n", count);
-
- for(i=0;i(fread(inBuf, 1, BUFFERSIZE , f))) > 0) )
- {
- // Convert bytes to unicode
- source = inBuf;
- sourceLimit = inBuf + count;
-
- do
- {
- target = uBuf;
- targetLimit = uBuf + uBufSize;
-
- ucnv_toUnicode(conv, &target, targetLimit,
- &source, sourceLimit, nullptr,
- feof(f)?true:false, /* pass 'flush' when eof */
- /* is true (when no more data will come) */
- &status);
-
- if(status == U_BUFFER_OVERFLOW_ERROR)
- {
- // simply ran out of space - we'll reset the target ptr the next
- // time through the loop.
- status = U_ZERO_ERROR;
- }
- else
- {
- // Check other errors here.
- assert(U_SUCCESS(status));
- // Break out of the loop (by force)
- }
-
- // Process the Unicode
- // Todo: handle UTF-16/surrogates
-
- for(p = uBuf; p(sizeof(CharFreqInfo)*charCount));
- }
-
- /* reset frequencies */
- for(p=0;p(fread(inBuf, 1, BUFFERSIZE , f))) > 0) )
- {
- // Convert bytes to unicode
- source = inBuf;
- sourceLimit = inBuf + count;
-
- while(source < sourceLimit)
- {
- p = ucnv_getNextUChar(conv, &source, sourceLimit, &status);
- if(U_FAILURE(status))
- {
- fprintf(stderr, "%s @ %d\n", u_errorName(status), total);
- status = U_ZERO_ERROR;
- continue;
- }
- U_ASSERT(status);
- total++;
-
- if(u_isalpha(p))
- letters++;
-
- if((u_tolower(l) == 'i') && (u_tolower(p) == 'e'))
- ie++;
-
- if((u_tolower(l) == 'g') && (u_tolower(p) == 0x0127))
- gh++;
-
- if(p>charCount)
- {
- fprintf(stderr, "U+%06X: oh.., we only handle BMP characters so far.. redesign!\n", p);
- free(info);
- fclose(f);
- ucnv_close(conv);
- return U_UNSUPPORTED_ERROR;
- }
- info[p].frequency++;
- l = p;
- }
- }
-
- fclose(f);
- ucnv_close(conv);
-
- printf("%d letters out of %d total UChars.\n", letters, total);
- printf("%d ie digraphs, %d gh digraphs.\n", ie, gh);
-
- // now, we could sort it..
-
- // qsort(info, charCount, sizeof(info[0]), charfreq_compare);
-
- for(p=0;p unicode conversion\n");
-
-
- // **************************** START SAMPLE *******************
-
- char source[] = { 0x63, 0x61, 0x74, (char)0x94, 0x4C, (char)0x82, 0x6E, (char)0x82, 0x6A, 0x00 };
- char16_t target[100];
- UErrorCode status = U_ZERO_ERROR;
- UConverter *conv;
- int32_t len;
-
- // set up the converter
- conv = ucnv_open("shift_jis", &status);
- assert(U_SUCCESS(status));
-
- // convert to Unicode
- // Note: we can use strlen, we know it's an 8 bit null terminated codepage
- target[6] = 0xFDCA;
- len = ucnv_toUChars(conv, target, 100, source, static_cast(strlen(source)), &status);
- U_ASSERT(status);
- // close the converter
- ucnv_close(conv);
-
- // ***************************** END SAMPLE ********************
-
- // Print it out
- printBytes("src", source, static_cast(strlen(source)) );
- printf("\n");
- printUChars("targ", target, len);
-
- return U_ZERO_ERROR;
-}
-
-/******************************************************************
- C: Convert from codepage to Unicode one at a time.
-*/
-
-UErrorCode convsample_13()
-{
- printf("\n\n==============================================\n"
- "Sample 13: C: simple Big5 -> unicode conversion, char at a time\n");
-
-
- const char sourceChars[] = { 0x7a, 0x68, 0x3d, (char)0xa4, (char)0xa4, (char)0xa4, (char)0xe5, (char)0x2e };
- // const char sourceChars[] = { 0x7a, 0x68, 0x3d, 0xe4, 0xb8, 0xad, 0xe6, 0x96, 0x87, 0x2e };
- const char *source, *sourceLimit;
- UChar32 target;
- UErrorCode status = U_ZERO_ERROR;
- UConverter *conv = nullptr;
- int32_t srcCount=0;
- int32_t dstCount=0;
-
- srcCount = sizeof(sourceChars);
-
- conv = ucnv_open("Big5", &status);
- U_ASSERT(status);
-
- source = sourceChars;
- sourceLimit = sourceChars + sizeof(sourceChars);
-
- // **************************** START SAMPLE *******************
-
-
- printBytes("src", source, static_cast(sourceLimit - source));
-
- while(source < sourceLimit)
- {
- puts("");
- target = ucnv_getNextUChar (conv,
- &source,
- sourceLimit,
- &status);
-
- // printBytes("src",source,sourceLimit-source);
- U_ASSERT(status);
- printUChar(target);
- dstCount++;
- }
-
-
- // ************************** END SAMPLE *************************
-
- printf("src=%d bytes, dst=%d uchars\n", srcCount, dstCount);
- ucnv_close(conv);
-
- return U_ZERO_ERROR;
-}
-
-
-
-
-UBool convsample_20_didSubstitute(const char *source)
-{
- char16_t uchars[100];
- char bytes[100];
- UConverter *conv = nullptr;
- UErrorCode status = U_ZERO_ERROR;
- uint32_t len, len2;
- UBool flagVal;
-
- FromUFLAGContext * context = nullptr;
-
- printf("\n\n==============================================\n"
- "Sample 20: C: Test for substitution using callbacks\n");
-
- /* print out the original source */
- printBytes("src", source);
- printf("\n");
-
- /* First, convert from UTF8 to unicode */
- conv = ucnv_open("utf-8", &status);
- U_ASSERT(status);
-
- len = ucnv_toUChars(conv, uchars, 100, source, static_cast(strlen(source)), &status);
- U_ASSERT(status);
-
- printUChars("uch", uchars, len);
- printf("\n");
-
- /* Now, close the converter */
- ucnv_close(conv);
-
- /* Now, convert to windows-1252 */
- conv = ucnv_open("windows-1252", &status);
- U_ASSERT(status);
-
- /* Converter starts out with the SUBSTITUTE callback set. */
-
- /* initialize our callback */
- context = flagCB_fromU_openContext();
-
- /* Set our special callback */
- ucnv_setFromUCallBack(conv,
- flagCB_fromU,
- context,
- &(context->subCallback),
- &(context->subContext),
- &status);
-
- U_ASSERT(status);
-
- len2 = ucnv_fromUChars(conv, bytes, 100, uchars, len, &status);
- U_ASSERT(status);
-
- flagVal = context->flag; /* it's about to go away when we close the cnv */
-
- ucnv_close(conv);
-
- /* print out the original source */
- printBytes("bytes", bytes, len2);
-
- return flagVal; /* true if callback was called */
-}
-
-UErrorCode convsample_20()
-{
- const char *sample1 = "abc\xdf\xbf";
- const char *sample2 = "abc_def";
-
-
- if(convsample_20_didSubstitute(sample1))
- {
- printf("DID substitute.\n******\n");
- }
- else
- {
- printf("Did NOT substitute.\n*****\n");
- }
-
- if(convsample_20_didSubstitute(sample2))
- {
- printf("DID substitute.\n******\n");
- }
- else
- {
- printf("Did NOT substitute.\n*****\n");
- }
-
- return U_ZERO_ERROR;
-}
-
-// 21 - C, callback, with clone and debug
-
-
-
-UBool convsample_21_didSubstitute(const char *source)
-{
- char16_t uchars[100];
- char bytes[100];
- UConverter *conv = nullptr, *cloneCnv = nullptr;
- UErrorCode status = U_ZERO_ERROR;
- uint32_t len, len2;
- UBool flagVal = false;
- UConverterFromUCallback junkCB;
-
- FromUFLAGContext *flagCtx = nullptr,
- *cloneFlagCtx = nullptr;
-
- debugCBContext *debugCtx1 = nullptr,
- *debugCtx2 = nullptr,
- *cloneDebugCtx = nullptr;
-
- printf("\n\n==============================================\n"
- "Sample 21: C: Test for substitution w/ callbacks & clones \n");
-
- /* print out the original source */
- printBytes("src", source);
- printf("\n");
-
- /* First, convert from UTF8 to unicode */
- conv = ucnv_open("utf-8", &status);
- U_ASSERT(status);
-
- len = ucnv_toUChars(conv, uchars, 100, source, static_cast(strlen(source)), &status);
- U_ASSERT(status);
-
- printUChars("uch", uchars, len);
- printf("\n");
-
- /* Now, close the converter */
- ucnv_close(conv);
-
- /* Now, convert to windows-1252 */
- conv = ucnv_open("windows-1252", &status);
- U_ASSERT(status);
-
- /* Converter starts out with the SUBSTITUTE callback set. */
-
- /* initialize our callback */
- /* from the 'bottom' innermost, out
- * CNV -> debugCtx1[debug] -> flagCtx[flag] -> debugCtx2[debug] */
-
-#if DEBUG_TMI
- printf("flagCB_fromU = %p\n", &flagCB_fromU);
- printf("debugCB_fromU = %p\n", &debugCB_fromU);
-#endif
-
- debugCtx1 = debugCB_openContext();
- flagCtx = flagCB_fromU_openContext();
- debugCtx2 = debugCB_openContext();
-
- debugCtx1->subCallback = flagCB_fromU; /* debug1 -> flag */
- debugCtx1->subContext = flagCtx;
-
- flagCtx->subCallback = debugCB_fromU; /* flag -> debug2 */
- flagCtx->subContext = debugCtx2;
-
- debugCtx2->subCallback = UCNV_FROM_U_CALLBACK_SUBSTITUTE;
- debugCtx2->subContext = nullptr;
-
- /* Set our special callback */
-
- ucnv_setFromUCallBack(conv,
- debugCB_fromU,
- debugCtx1,
- &(debugCtx2->subCallback),
- &(debugCtx2->subContext),
- &status);
-
- U_ASSERT(status);
-
-#if DEBUG_TMI
- printf("Callback chain now: Converter %p -> debug1:%p-> (%p:%p)==flag:%p -> debug2:%p -> cb %p\n",
- conv, debugCtx1, debugCtx1->subCallback,
- debugCtx1->subContext, flagCtx, debugCtx2, debugCtx2->subCallback);
-#endif
-
- cloneCnv = ucnv_safeClone(conv, nullptr, nullptr, &status);
-
- U_ASSERT(status);
-
-#if DEBUG_TMI
- printf("Cloned converter from %p -> %p. Closing %p.\n", conv, cloneCnv, conv);
-#endif
-
- ucnv_close(conv);
-
-#if DEBUG_TMI
- printf("%p closed.\n", conv);
-#endif
-
- U_ASSERT(status);
- /* Now, we have to extract the context */
- cloneDebugCtx = nullptr;
- cloneFlagCtx = nullptr;
-
- ucnv_getFromUCallBack(cloneCnv, &junkCB, (const void **)&cloneDebugCtx);
- if(cloneDebugCtx != nullptr) {
- cloneFlagCtx = (FromUFLAGContext*) cloneDebugCtx -> subContext;
- }
-
- printf("Cloned converter chain: %p -> %p[debug1] -> %p[flag] -> %p[debug2] -> substitute\n",
- cloneCnv, cloneDebugCtx, cloneFlagCtx, cloneFlagCtx?cloneFlagCtx->subContext:nullptr );
-
- len2 = ucnv_fromUChars(cloneCnv, bytes, 100, uchars, len, &status);
- U_ASSERT(status);
-
- if(cloneFlagCtx != nullptr) {
- flagVal = cloneFlagCtx->flag; /* it's about to go away when we close the cnv */
- } else {
- printf("** Warning, couldn't get the subcallback \n");
- }
-
- ucnv_close(cloneCnv);
-
- /* print out the original source */
- printBytes("bytes", bytes, len2);
-
- return flagVal; /* true if callback was called */
-}
-
-UErrorCode convsample_21()
-{
- const char *sample1 = "abc\xdf\xbf";
- const char *sample2 = "abc_def";
-
- if(convsample_21_didSubstitute(sample1))
- {
- printf("DID substitute.\n******\n");
- }
- else
- {
- printf("Did NOT substitute.\n*****\n");
- }
-
- if(convsample_21_didSubstitute(sample2))
- {
- printf("DID substitute.\n******\n");
- }
- else
- {
- printf("Did NOT substitute.\n*****\n");
- }
-
- return U_ZERO_ERROR;
-}
-
-
-// 40- C, cp37 -> UTF16 [data02.bin -> data40.utf16]
-
-#define BUFFERSIZE 17 /* make it interesting :) */
-
-UErrorCode convsample_40()
-{
- printf("\n\n==============================================\n"
- "Sample 40: C: convert data02.bin from cp37 to UTF16 [data40.utf16]\n");
-
- FILE *f;
- FILE *out;
- int32_t count;
- char inBuf[BUFFERSIZE];
- const char *source;
- const char *sourceLimit;
- char16_t *uBuf;
- char16_t *target;
- char16_t *targetLimit;
- int32_t uBufSize = 0;
- UConverter *conv = nullptr;
- UErrorCode status = U_ZERO_ERROR;
- uint32_t inbytes=0, total=0;
-
- f = fopen("data02.bin", "rb");
- if(!f)
- {
- fprintf(stderr, "Couldn't open file 'data02.bin' (cp37 data file).\n");
- return U_FILE_ACCESS_ERROR;
- }
-
- out = fopen("data40.utf16", "wb");
- if(!out)
- {
- fprintf(stderr, "Couldn't create file 'data40.utf16'.\n");
- fclose(f);
- return U_FILE_ACCESS_ERROR;
- }
-
- // **************************** START SAMPLE *******************
- conv = ucnv_openCCSID(37, UCNV_IBM, &status);
- assert(U_SUCCESS(status));
-
- uBufSize = (BUFFERSIZE/ucnv_getMinCharSize(conv));
- printf("input bytes %d / min chars %d = %d UChars\n",
- BUFFERSIZE, ucnv_getMinCharSize(conv), uBufSize);
- uBuf = (char16_t*)malloc(uBufSize * sizeof(char16_t));
- assert(uBuf!=nullptr);
-
- // grab another buffer's worth
- while((!feof(f)) &&
- ((count=static_cast(fread(inBuf, 1, BUFFERSIZE , f))) > 0) )
- {
- inbytes += count;
-
- // Convert bytes to unicode
- source = inBuf;
- sourceLimit = inBuf + count;
-
- do
- {
- target = uBuf;
- targetLimit = uBuf + uBufSize;
-
- ucnv_toUnicode( conv, &target, targetLimit,
- &source, sourceLimit, nullptr,
- feof(f)?true:false, /* pass 'flush' when eof */
- /* is true (when no more data will come) */
- &status);
-
- if(status == U_BUFFER_OVERFLOW_ERROR)
- {
- // simply ran out of space - we'll reset the target ptr the next
- // time through the loop.
- status = U_ZERO_ERROR;
- }
- else
- {
- // Check other errors here.
- assert(U_SUCCESS(status));
- // Break out of the loop (by force)
- }
-
- // Process the Unicode
- // Todo: handle UTF-16/surrogates
- assert(fwrite(uBuf, sizeof(uBuf[0]), (target-uBuf), out) == (size_t)(target-uBuf));
- total += static_cast((target-uBuf));
- } while (source < sourceLimit); // while simply out of space
- }
-
- printf("%d bytes in, %d UChars out.\n", inbytes, total);
-
- // ***************************** END SAMPLE ********************
- ucnv_close(conv);
-
- fclose(f);
- fclose(out);
- printf("\n");
-
- return U_ZERO_ERROR;
-}
-#undef BUFFERSIZE
-
-
-
-// 46- C, UTF16 -> latin2 [data40.utf16 -> data46.out]
-
-#define BUFFERSIZE 24 /* make it interesting :) */
-
-UErrorCode convsample_46()
-{
- printf("\n\n==============================================\n"
- "Sample 46: C: convert data40.utf16 from UTF16 to latin2 [data46.out]\n");
-
- FILE *f;
- FILE *out;
- int32_t count;
- char16_t inBuf[BUFFERSIZE];
- const char16_t *source;
- const char16_t *sourceLimit;
- char *buf;
- char *target;
- char *targetLimit;
-
- int32_t bufSize = 0;
- UConverter *conv = nullptr;
- UErrorCode status = U_ZERO_ERROR;
- uint32_t inchars=0, total=0;
-
- f = fopen("data40.utf16", "rb");
- if(!f)
- {
- fprintf(stderr, "Couldn't open file 'data40.utf16' (did you run convsample_40() ?)\n");
- return U_FILE_ACCESS_ERROR;
- }
-
- out = fopen("data46.out", "wb");
- if(!out)
- {
- fprintf(stderr, "Couldn't create file 'data46.out'.\n");
- fclose(f);
- return U_FILE_ACCESS_ERROR;
- }
-
- // **************************** START SAMPLE *******************
- conv = ucnv_open( "iso-8859-2", &status);
- assert(U_SUCCESS(status));
-
- bufSize = (BUFFERSIZE*ucnv_getMaxCharSize(conv));
- printf("input UChars[16] %d * max charsize %d = %d bytes output buffer\n",
- BUFFERSIZE, ucnv_getMaxCharSize(conv), bufSize);
- buf = (char*)malloc(bufSize * sizeof(char));
- assert(buf!=nullptr);
-
- // grab another buffer's worth
- while((!feof(f)) &&
- ((count=static_cast(fread(inBuf, sizeof(char16_t), BUFFERSIZE , f))) > 0) )
- {
- inchars += count;
-
- // Convert bytes to unicode
- source = inBuf;
- sourceLimit = inBuf + count;
-
- do
- {
- target = buf;
- targetLimit = buf + bufSize;
-
- ucnv_fromUnicode( conv, &target, targetLimit,
- &source, sourceLimit, nullptr,
- feof(f)?true:false, /* pass 'flush' when eof */
- /* is true (when no more data will come) */
- &status);
-
- if(status == U_BUFFER_OVERFLOW_ERROR)
- {
- // simply ran out of space - we'll reset the target ptr the next
- // time through the loop.
- status = U_ZERO_ERROR;
- }
- else
- {
- // Check other errors here.
- assert(U_SUCCESS(status));
- // Break out of the loop (by force)
- }
-
- // Process the Unicode
- assert(fwrite(buf, sizeof(buf[0]), (target-buf), out) == (size_t)(target-buf));
- total += static_cast((target-buf));
- } while (source < sourceLimit); // while simply out of space
- }
-
- printf("%d Uchars (%d bytes) in, %d chars out.\n", inchars, static_cast(inchars * sizeof(char16_t)), total);
-
- // ***************************** END SAMPLE ********************
- ucnv_close(conv);
-
- fclose(f);
- fclose(out);
- printf("\n");
-
- return U_ZERO_ERROR;
-}
-#undef BUFFERSIZE
-
-#define BUFFERSIZE 219
-
-void convsample_50() {
- printf("\n\n==============================================\n"
- "Sample 50: C: ucnv_detectUnicodeSignature\n");
-
- //! [ucnv_detectUnicodeSignature]
- UErrorCode err = U_ZERO_ERROR;
- UBool discardSignature = true; /* set to true to throw away the initial U+FEFF */
- char input[] = { '\xEF','\xBB', '\xBF','\x41','\x42','\x43' };
- int32_t signatureLength = 0;
- const char *encoding = ucnv_detectUnicodeSignature(input,sizeof(input),&signatureLength,&err);
- UConverter *conv = nullptr;
- char16_t output[100];
- char16_t *target = output, *out;
- const char *source = input;
- if(encoding!=nullptr && U_SUCCESS(err)){
- // should signature be discarded ?
- conv = ucnv_open(encoding, &err);
- // do the conversion
- ucnv_toUnicode(conv,
- &target, output + UPRV_LENGTHOF(output),
- &source, input + sizeof(input),
- nullptr, true, &err);
- out = output;
- if (discardSignature){
- ++out; // ignore initial U+FEFF
- }
- while(out != target) {
- printf("%04x ", *out++);
- }
- puts("");
- }
- //! [ucnv_detectUnicodeSignature]
- puts("");
-}
-
-
-
-/* main */
-
-int main()
-{
-
- printf("Default Converter=%s\n", ucnv_getDefaultName() );
-
- convsample_02(); // C , u->koi8r, conv
- convsample_03(); // C, iterate
-
- convsample_05(); // C, utf8->u, getNextUChar
- convsample_06(); // C freq counter thingy
-
- convsample_12(); // C, sjis->u, conv
- convsample_13(); // C, big5->u, getNextU
-
- convsample_20(); // C, callback
- convsample_21(); // C, callback debug
-
- convsample_40(); // C, cp37 -> UTF16 [data02.bin -> data40.utf16]
-
- convsample_46(); // C, UTF16 -> latin3 [data41.utf16 -> data46.out]
-
- convsample_50(); // C, detect unicode signature
-
- printf("End of converter samples.\n");
-
- fflush(stdout);
- fflush(stderr);
-
- return 0;
-}
diff --git a/icu4c/source/samples/ucnv/data01.txt b/icu4c/source/samples/ucnv/data01.txt
deleted file mode 100644
index 5b53359cd46..00000000000
--- a/icu4c/source/samples/ucnv/data01.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-п»ї-*- Coding: utf-8 ; -*- // for emacs
-[some latin, devanagari, and cyrillic text]
-raj Rajasthani राजेस्थानी
- Konkani कोंकणी
- Haryanvi हरियानवी
-rm Rhaeto-Romance रहेय्टो-रोमान्स
-rn Kirundi किरून्दी
-ro Romanian रूमानीयन्
-ru Russian रुसी футбол
-том
-атом
-Нева
-Fid-dinja hawn aktar imДЎienen minn nies f'sensiehom.
-Il-mistoqsija oħt il-għerf. (Asking is the sister of knowing.)
-aфутбол중앙일보-の“日本語”
diff --git a/icu4c/source/samples/ucnv/data02.bin b/icu4c/source/samples/ucnv/data02.bin
deleted file mode 100644
index e1a5aad9e51..00000000000
--- a/icu4c/source/samples/ucnv/data02.bin
+++ /dev/null
@@ -1 +0,0 @@
-є…§ѓ…™—Ј@ЈЁ—…„@‚Ё@ў™“|”–•’…ЁKў‚ЃЁK–™‡@ј@%@€ЈЈ—zaa¦¦¦K”–•’…ЁKў‚ЃЁK–™‡aЎў™“a€Ѓ”–ѓЈa»%%И‰ўЈ–™Ё@Ѓ•„@ФЁўЈ…™Ё@–†@Г–””–•@㈉•‡ў@‚Ё@ГK@жK@Б““…•%Х…¦@и–™’z@У…ЃҐ‰Ј@P@Б““…•@В™–ўKk@ш@И–¦Ѓ™„@вЈ™……ЈK%%Е•Ј…™…„@Ѓѓѓ–™„‰•‡@Ј–@Ј€…@БѓЈ@–†@Г–•‡™…ўў@‰•@Ј€…@Ё…Ѓ™@сшхщk%ВЁ@жKБK@г–¦•ў…•„@P@Г–Kk%‰•@Ј€…@Г“…™’}ў@Ц††‰ѓ…@–†@Ј€…@Д‰ўѓЈ‰ѓЈ@Г–¤™Ј@†–™@Ј€…@в–¤Ј€…™•@Д‰ўЈ™‰ѓЈ@–†@Х…¦@и–™’K@%%јјјјБ‚–¤Ј@г…Ѓk@Г–††……k@…ЈѓKјјјјјј%%єЧЃ‡…@сс»%%ж€ЃЈ@‰ў@г…Ѓo@%%г€…@“…ЃҐ…ў@–†@Ѓ@ў€™¤‚@‡™–¦•@ѓ€‰…†“Ё@‰•@Г€‰•Ѓ@Ѓ•„@СЃ—Ѓ•^@–†@¦€‰ѓ€@ѓ–¤•Ј™‰…ў@‰Ј@‰ў@Ѓ@•ЃЈ‰Ґ…K@ЙЈ@‰ў@Ѓ•@…Ґ…™‡™……•k@‡™–¦ў@Ј–@Ј€…@€…‰‡€Ј@–†@†™–”@†–¤™@Ј–%ў‰§@†……Јk@Ѓ•„@‚…Ѓ™ў@—™…ЈЈЁ@¦€‰Ј…@†“–¦…™ўk@™…ў…”‚“‰•‡@¦‰“„@™–ў…ўK%%Йў@Ј€…™…@”–™…@Ј€Ѓ•@–•…@ў—…ѓ‰…ў@–†@Ј€…@г…Ѓ@Ч“Ѓ•Јo@%%и…ўk@ў…Ґ…™Ѓ“^@Ј€–ў…@”–ўЈ@ѓ¤“Ј‰ҐЃЈ…„@Ѓ™…@Ј€…@г€…Ѓ@‚–€…Ѓ@Ѓ•„@г€…Ѓ@Ґ‰™‰„‰ў^@‰Ј@¦Ѓў@†–™”…™“Ё@‚…“‰…Ґ…„@Ј€ЃЈ@Ј€…ў…@Ј¦–@—“Ѓ•Јў@—™–„¤ѓ…„@Ј€…@‚“Ѓѓ’@Ѓ•„%‡™……•@Ј…Ѓўk@Ѓ•„@†™–”@Ј€‰ў@‚…“‰…†@Ј€…Ё@„…™‰Ґ…„@Ј€…‰™@•Ѓ”…ў^@‚¤Ј@‰Ј@‰ў@•–¦@—™–Ґ…„@Ј€ЃЈ@Ј€…@„‰††…™…•ѓ…@Ѓ™‰ў…ў@‰•@Ј€…@”–„…@–†@—™…—…™ЃЈ‰–•k@Ѓ•„@…‰Ј€…™%’‰•„@–†@Ј…Ѓ@ѓЃ•@‚…@”Ѓ„…@†™–”@…‰Ј€…™@—“Ѓ•Ј@¦‰Ј€–¤Ј@„‰††‰ѓ¤“ЈЁK%%И–¦@‰ў@Ј€…@г…Ѓ@Ч“Ѓ•Ј@Г¤“Ј‰ҐЃЈ…„o%%Й•@Г€‰•Ѓ@Ј€…™…@Ѓ™…@‡™…ЃЈ@•¤”‚…™ў@–†@Ј…Ѓ`†Ѓ™”ўk@‡…•…™Ѓ““Ё@–†@ў”Ѓ““@…§Ј…•Јk@ў‰Ј¤ЃЈ…„@–•@Ј€…@¤——…™@ҐЃ““…Ёўk@Ѓ•„@–•@Ј€…@ў“–—‰•‡@ў‰„…ў@–†@Ј€…@€‰““ўk%¦€…™…@Ј€…@ў–‰“@‰ў@“‰‡€Ј@Ѓ•„@™‰ѓ€k@Ѓ•„@¦…^“@„™Ѓ‰•…„K@г€…@—“Ѓ•Јў@Ѓ™…@™Ѓ‰ў…„@†™–”@ў……„k@Ѓ•„@‡…•…™Ѓ““Ё@Ѓ““–¦…„@Ј–@™…”Ѓ‰•@Ј€™……@Ё…Ѓ™ў@‚…†–™…@Ѓ@ѓ™–—@–†%“…ЃҐ…ў@‰ў@ЈЃ’…‰•@†™–”@Ј€…”k@Ѓў@Ј€‰ў@–—…™ЃЈ‰–•@–†@ѓ–¤™ў…@‰•‘¤™…ў@Ј€…‰™@‡™–¦Ј€^@…Ґ…•@¦‰Ј€@ѓЃ™…k@Ј€…Ё@‚…ѓ–”…@ўЈ¤•Ј…„k@Ѓ•„@¤•—™–†‰ЈЃ‚“…@‰•@Ѓ‚–¤Ј@…‰‡€Ј%–™@Ј…•@Ё…Ѓ™ўK@ж€…•@Ј€…@ѓ™–—@‰ў@™…Ѓ„Ёk@Ј€…@“…ЃҐ…ў@Ѓ™…@ѓЃ™…†¤““Ё@—‰ѓ’…„@‚Ё@€Ѓ•„@–•…@‚Ё@–•…k@Ѓ•„@Ј€…™…@Ѓ™…@¤ў¤Ѓ““Ё@Ј€™……@–™@†–¤™@‡ЃЈ€…™‰•‡ў@‰•@…Ѓѓ€%Ё…Ѓ™k@Ј€…@†‰™ўЈ@ѓ™–—@‰•@Ј€…@ў—™‰•‡@‚…‰•‡@–†@Ј€…@”–ўЈ@ҐЃ“¤…^@Ѓ@¦…““`‡™–¦•@‚¤ў€k@¦…““@Ј™…ЃЈ…„k@¦‰““@—™–„¤ѓ…@Ј¦–@–™@Ј€™……@—–¤•„ў@–†@Ј…Ѓ@Ѓ••¤Ѓ““ЁK%
\ No newline at end of file
diff --git a/icu4c/source/samples/ucnv/data06.txt b/icu4c/source/samples/ucnv/data06.txt
deleted file mode 100644
index 98b97c9c680..00000000000
--- a/icu4c/source/samples/ucnv/data06.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-п»ї// *******************************************************************************
-// *
-// * Copyright (C) 2016 and later: Unicode, Inc. and others.
-// * License & terms of use: http://www.unicode.org/copyright.html
-// *
-// *******************************************************************************
-// *******************************************************************************
-// *
-// * Copyright (C) 1997-2000, International Business Machines
-// * Corporation and others. All Rights Reserved.
-// *
-// *******************************************************************************
-
-
-
-fa {
-
- Version { "x0.0" }
-
-
- DayAbbreviations {
- "ЫЊв€”",
- "ШЇв€”",
- "Шів€”",
- "Ъ†в€”",
- "Щѕв€”",
- "Ш¬в€”",
- "Шґв€”",
- }
- DayNames {
- "یی‌شنبه",
- "ШЇЩ€ШґЩ†ШЁЩ‡",
- "سه‌شنبه",
- "Ъ†Щ‡Ш§Ш±ШґЩ†ШЁЩ‡",
- "پنج‌شنبه",
- "Ш¬Щ…Ш№Щ‡",
- "ШґЩ†ШЁЩ‡",
- }
- MonthAbbreviations {
- "ЪШ§Щ†",
- "ЩЃЩ€Ш±",
- "Щ…Ш§Ш±",
- "ШўЩ€Ш±",
- "Щ…ЩЂЩ‡",
- "ЪЩ€Щ†",
- "ЪЩ€ЫЊ",
- "Ш§Щ€ШЄ",
- "ШіЩѕШЄ",
- "Ш§ЩѓШЄ",
- "Щ†Щ€Ш§",
- "ШЇШіШ§",
- "",
- }
- MonthNames {
- "ЪШ§Щ†Щ€ЫЊЩ‡",
- "ЩЃЩ€Ш±Щ€ЫЊЩ‡",
- "Щ…Ш§Ш±Ші",
- "ШўЩ€Ш±ЫЊЩ„",
- "Щ…Щ‡",
- "ЪЩ€Ш¦Щ†",
- "ЪЩ€Ш¦ЫЊЩ‡",
- "Ш§Щ€ШЄ",
- "ШіЩѕШЄШ§Щ…ШЁШ±",
- "Ш§ЩѓШЄШЁШ±",
- "Щ†Щ€Ш§Щ…ШЁШ±",
- "ШЇШіШ§Щ…ШЁШ±",
- "",
- }
- NumberElements {
- "Щ«",
- "Щ¬",
- ";",
- "%",
- "0",
- "#",
- "-",
- "E",
- "‰",
- "в€ћ",
- "пїЅ",
- }
- NumberPatterns {
- "#,##0.###;-#,##0.###",
- "#,##0.#В¤;#,##0.#- В¤",
- "#,##0%",
- }
- LocaleID{ "29"}
- // /**************** Info Below is needed ****************/
- // CollationElements{}
- // Countries{}
- // Eras{}
- // Languages{}
- // ShortLanguage { }
- // localPatternChars{}
- //
-}
diff --git a/icu4c/source/samples/ucnv/flagcb.c b/icu4c/source/samples/ucnv/flagcb.c
deleted file mode 100644
index da275a1701d..00000000000
--- a/icu4c/source/samples/ucnv/flagcb.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/**************************************************************************
- * В© 2016 and later: Unicode, Inc. and others.
- * License & terms of use: http://www.unicode.org/copyright.html
- **************************************************************************
- **************************************************************************
- * COPYRIGHT:
- * Copyright (c) 1999-2007, International Business Machines Corporation and
- * others. All Rights Reserved.
- **************************************************************************/
-
-#include "unicode/utypes.h"
-#include "unicode/ucnv.h"
-#include "flagcb.h"
-#include
-#include
-#include
-
-#define DEBUG_TMI 0 /* set to 1 for Too Much Information (TMI) */
-
-U_CAPI FromUFLAGContext* U_EXPORT2 flagCB_fromU_openContext()
-{
- FromUFLAGContext *ctx;
-
- ctx = (FromUFLAGContext*) malloc(sizeof(FromUFLAGContext));
-
- ctx->subCallback = NULL;
- ctx->subContext = NULL;
- ctx->flag = false;
-
- return ctx;
-}
-
-U_CAPI void U_EXPORT2 flagCB_fromU(
- const void *context,
- UConverterFromUnicodeArgs *fromUArgs,
- const UChar* codeUnits,
- int32_t length,
- UChar32 codePoint,
- UConverterCallbackReason reason,
- UErrorCode * err)
-{
- /* First step - based on the reason code, take action */
-
- if(reason == UCNV_UNASSIGNED) { /* whatever set should be trapped here */
- ((FromUFLAGContext*)context)->flag = true;
- }
-
- if(reason == UCNV_CLONE) {
- /* The following is the recommended way to implement UCNV_CLONE
- in a callback. */
- UConverterFromUCallback saveCallback;
- const void *saveContext;
- FromUFLAGContext *old, *cloned;
- UErrorCode subErr = U_ZERO_ERROR;
-
-#if DEBUG_TMI
- printf("*** FLAGCB: cloning %p ***\n", context);
-#endif
- old = (FromUFLAGContext*)context;
- cloned = flagCB_fromU_openContext();
-
- memcpy(cloned, old, sizeof(FromUFLAGContext));
-
-#if DEBUG_TMI
- printf("%p: my subcb=%p:%p\n", old, old->subCallback,
- old->subContext);
- printf("%p: cloned subcb=%p:%p\n", cloned, cloned->subCallback,
- cloned->subContext);
-#endif
-
- /* We need to get the sub CB to handle cloning,
- * so we have to set up the following, temporarily:
- *
- * - Set the callback+context to the sub of this (flag) cb
- * - preserve the current cb+context, it could be anything
- *
- * Before:
- * CNV -> FLAG -> subcb -> ...
- *
- * After:
- * CNV -> subcb -> ...
- *
- * The chain from 'something' on is saved, and will be restored
- * at the end of this block.
- *
- */
-
- ucnv_setFromUCallBack(fromUArgs->converter,
- cloned->subCallback,
- cloned->subContext,
- &saveCallback,
- &saveContext,
- &subErr);
-
- if( cloned->subCallback != NULL ) {
- /* Now, call the sub callback if present */
- cloned->subCallback(cloned->subContext, fromUArgs, codeUnits,
- length, codePoint, reason, err);
- }
-
- ucnv_setFromUCallBack(fromUArgs->converter,
- saveCallback, /* Us */
- cloned, /* new context */
- &cloned->subCallback, /* IMPORTANT! Accept any change in CB or context */
- &cloned->subContext,
- &subErr);
-
- if(U_FAILURE(subErr)) {
- *err = subErr;
- }
- }
-
- /* process other reasons here if need be */
-
- /* Always call the subCallback if present */
- if(((FromUFLAGContext*)context)->subCallback != NULL &&
- reason != UCNV_CLONE) {
- ((FromUFLAGContext*)context)->subCallback( ((FromUFLAGContext*)context)->subContext,
- fromUArgs,
- codeUnits,
- length,
- codePoint,
- reason,
- err);
- }
-
- /* cleanup - free the memory AFTER calling the sub CB */
- if(reason == UCNV_CLOSE) {
- free((void*)context);
- }
-}
-
-/* Debugging callback, just outputs what happens */
-
-/* Test safe clone callback */
-
-static uint32_t debugCB_nextSerial()
-{
- static uint32_t n = 1;
-
- return (n++);
-}
-
-static void debugCB_print_log(debugCBContext *q, const char *name)
-{
- if(q==NULL) {
- printf("debugCBontext: %s is NULL!!\n", name);
- } else {
- if(q->magic != 0xC0FFEE) {
- fprintf(stderr, "debugCBContext: %p:%d's magic is %x, supposed to be 0xC0FFEE\n",
- q,q->serial, q->magic);
- }
- printf("debugCBContext %p:%d=%s - magic %x\n",
- q, q->serial, name, q->magic);
- }
-}
-
-static debugCBContext *debugCB_clone(debugCBContext *ctx)
-{
- debugCBContext *newCtx;
- newCtx = malloc(sizeof(debugCBContext));
-
- newCtx->serial = debugCB_nextSerial();
- newCtx->magic = 0xC0FFEE;
-
- newCtx->subCallback = ctx->subCallback;
- newCtx->subContext = ctx->subContext;
-
-#if DEBUG_TMI
- printf("debugCB_clone: %p:%d -> new context %p:%d\n", ctx, ctx->serial, newCtx, newCtx->serial);
-#endif
-
- return newCtx;
-}
-
-void debugCB_fromU(const void *context,
- UConverterFromUnicodeArgs *fromUArgs,
- const UChar* codeUnits,
- int32_t length,
- UChar32 codePoint,
- UConverterCallbackReason reason,
- UErrorCode * err)
-{
- debugCBContext *ctx = (debugCBContext*)context;
- /*UConverterFromUCallback junkFrom;*/
-
-#if DEBUG_TMI
- printf("debugCB_fromU: Context %p:%d called, reason %d on cnv %p [err=%s]\n", ctx, ctx->serial, reason, fromUArgs->converter, u_errorName(*err));
-#endif
-
- if(ctx->magic != 0xC0FFEE) {
- fprintf(stderr, "debugCB_fromU: Context %p:%d magic is 0x%x should be 0xC0FFEE.\n", ctx,ctx->serial, ctx->magic);
- return;
- }
-
- if(reason == UCNV_CLONE) {
- /* see comments in above flagCB clone code */
-
- UConverterFromUCallback saveCallback;
- const void *saveContext;
- debugCBContext *cloned;
- UErrorCode subErr = U_ZERO_ERROR;
-
- /* "recreate" it */
-#if DEBUG_TMI
- printf("debugCB_fromU: cloning..\n");
-#endif
- cloned = debugCB_clone(ctx);
-
- if(cloned == NULL) {
- fprintf(stderr, "debugCB_fromU: internal clone failed on %p\n", ctx);
- *err = U_MEMORY_ALLOCATION_ERROR;
- return;
- }
-
- ucnv_setFromUCallBack(fromUArgs->converter,
- cloned->subCallback,
- cloned->subContext,
- &saveCallback,
- &saveContext,
- &subErr);
-
- if( cloned->subCallback != NULL) {
-#if DEBUG_TMI
- printf("debugCB_fromU:%p calling subCB %p\n", ctx, cloned->subCallback);
-#endif
- /* call subCB if present */
- cloned->subCallback(cloned->subContext, fromUArgs, codeUnits,
- length, codePoint, reason, err);
- } else {
- printf("debugCB_fromU:%p, NOT calling subCB, it's NULL\n", ctx);
- }
-
- /* set back callback */
- ucnv_setFromUCallBack(fromUArgs->converter,
- saveCallback, /* Us */
- cloned, /* new context */
- &cloned->subCallback, /* IMPORTANT! Accept any change in CB or context */
- &cloned->subContext,
- &subErr);
-
- if(U_FAILURE(subErr)) {
- *err = subErr;
- }
- }
-
- /* process other reasons here */
-
- /* always call subcb if present */
- if(ctx->subCallback != NULL && reason != UCNV_CLONE) {
- ctx->subCallback(ctx->subContext,
- fromUArgs,
- codeUnits,
- length,
- codePoint,
- reason,
- err);
- }
-
- if(reason == UCNV_CLOSE) {
-#if DEBUG_TMI
- printf("debugCB_fromU: Context %p:%d closing\n", ctx, ctx->serial);
-#endif
- free(ctx);
- }
-
-#if DEBUG_TMI
- printf("debugCB_fromU: leaving cnv %p, ctx %p: err %s\n", fromUArgs->converter, ctx, u_errorName(*err));
-#endif
-}
-
-debugCBContext *debugCB_openContext()
-{
- debugCBContext *ctx;
-
- ctx = malloc(sizeof(debugCBContext));
-
- if(ctx != NULL) {
- ctx->magic = 0xC0FFEE;
- ctx->serial = debugCB_nextSerial();
- ctx->subCallback = NULL;
- ctx->subContext = NULL;
-
-#if DEBUG_TMI
- fprintf(stderr, "debugCB:openContext opened[%p] = serial #%d\n", ctx, ctx->serial);
-#endif
-
- }
-
-
- return ctx;
-}
diff --git a/icu4c/source/samples/ucnv/flagcb.h b/icu4c/source/samples/ucnv/flagcb.h
deleted file mode 100644
index 2058903b5e8..00000000000
--- a/icu4c/source/samples/ucnv/flagcb.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* В© 2016 and later: Unicode, Inc. and others.
- License & terms of use: http://www.unicode.org/copyright.html
-
- Copyright (c) 2000 IBM, Inc. and Others.
- FLAGCB.H - interface to 'flagging' callback which
- simply marks the fact that the callback was called.
-*/
-
-#ifndef _FLAGCB
-#define _FLAGCB
-
-#include "unicode/utypes.h"
-#include "unicode/ucnv.h"
-
-/* The structure of a FromU Flag context.
- (conceivably there could be a ToU Flag Context) */
-
-typedef struct
-{
- UConverterFromUCallback subCallback;
- const void *subContext;
- UBool flag;
-} FromUFLAGContext;
-
-/**
- * open the context
- */
-
-U_CAPI FromUFLAGContext* U_EXPORT2 flagCB_fromU_openContext();
-
-/**
- * the actual callback
- */
-U_CAPI void U_EXPORT2 flagCB_fromU(
- const void *context,
- UConverterFromUnicodeArgs *fromUArgs,
- const UChar* codeUnits,
- int32_t length,
- UChar32 codePoint,
- UConverterCallbackReason reason,
- UErrorCode * err);
-
-
-
-typedef struct
-{
- UConverterFromUCallback subCallback;
- const void *subContext;
- uint32_t magic; /* 0xC0FFEE to identify that the object is OK */
- uint32_t serial; /* minted from nextSerial */
-} debugCBContext;
-
-U_CAPI void debugCB_fromU(const void *context,
- UConverterFromUnicodeArgs *fromUArgs,
- const UChar* codeUnits,
- int32_t length,
- UChar32 codePoint,
- UConverterCallbackReason reason,
- UErrorCode * err);
-
-U_CAPI debugCBContext *debugCB_openContext();
-
-#endif
diff --git a/icu4c/source/samples/ucnv/readme.txt b/icu4c/source/samples/ucnv/readme.txt
deleted file mode 100644
index 10987656dbd..00000000000
--- a/icu4c/source/samples/ucnv/readme.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-Copyright (C) 2016 and later: Unicode, Inc. and others.
-License & terms of use: http://www.unicode.org/copyright.html
-
-Copyright (C) 2002-2010, International Business Machines
-Corporation and others. All Rights Reserved.
-
-convsamp: a sample program which demonstrates using ICU conversion
-
-This sample demonstrates
- Opening and closing converters using the C api
- String manipulation in C
- Writing a custom conversion callback function
-
-
-Files:
- convsamp.c Main source file
- flagcb.h codepage output convenience header
- flagcb.c codepage output convenience implementation
- ucnv.sln Windows MSVC workspace. Double-click this to get started.
- ucnv.vcproj Windows MSVC project file
-
-To Build ucnv on Windows
- 1. Install and build ICU
- 2. In MSVC, open the workspace file icu\samples\ucnv\ucnv.sln
- 3. Choose a Debug or Release build.
- 4. Build.
-
-To Run on Windows
- 1. Start a command shell window
- 2. Add ICU's bin directory to the path, e.g.
- set PATH=c:\icu\bin;%PATH%
- (Use the path to where ever ICU is on your system.)
- 3. cd into the ufortune directory, e.g.
- cd c:\icu\source\samples\ucnv\debug
- 4. Run it
- ucnv
- WARNING: The .bin and .txt files must be in the same directory as the executable, which is not the case by default on some systems.
-
-To Build on Unixes
- 1. Build ICU.
- Specify an ICU install directory when running configure,
- using the --prefix option. The steps to build ICU will look something
- like this:
- cd /source
- runConfigureICU --prefix [other options]
- gmake all
-
- 2. Install ICU,
- gmake install
-
- 3. Build
- set the variable ICU_PREFIX=
- gmake all
-
- To Run on Unixes
- cd /source/samples/ucnv
-
- gmake check
- -or-
-
- export LD_LIBRARY_PATH=/lib:.:$LD_LIBRARY_PATH
- convsamp
-
-
- Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
- If in doubt, run the sample using "gmake check", and note the name of
- the variable that is used there. LD_LIBRARY_PATH is the correct name
- for Linux and Solaris.
-
diff --git a/icu4c/source/samples/ucnv/ucnv.sln b/icu4c/source/samples/ucnv/ucnv.sln
deleted file mode 100644
index 40673e3b8f6..00000000000
--- a/icu4c/source/samples/ucnv/ucnv.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ucnv", "ucnv.vcxproj", "{8C95060E-61F5-464E-BB42-95B788C0D7E4}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|Win32.ActiveCfg = Debug|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|Win32.Build.0 = Debug|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|x64.ActiveCfg = Debug|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Debug|x64.Build.0 = Debug|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|Win32.ActiveCfg = Release|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|Win32.Build.0 = Release|Win32
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|x64.ActiveCfg = Release|x64
- {8C95060E-61F5-464E-BB42-95B788C0D7E4}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/icu4c/source/samples/ucnv/ucnv.vcxproj b/icu4c/source/samples/ucnv/ucnv.vcxproj
deleted file mode 100644
index b131e4881bc..00000000000
--- a/icu4c/source/samples/ucnv/ucnv.vcxproj
+++ /dev/null
@@ -1,154 +0,0 @@
-п»ї
-
-