Meta tags:
description= ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode and Globalization support for software applications. The ICU User Guide provides documentation on how to use ICU.;
Headings (most frequently used words):
test, icu4c, check, and, demos, code, for, obsolete, headers, icu4j, in, source, files, utf, file, line, the, samples, via, docker, from, build, healthy, contents, classid, new, class, hierarchies, non, ascii, characters, valid, correct, text, endings, properties, clean, up, import, statements, library, dependencies, verify, proper, memory, allocation, functions, run, static, analysis, tools, coverage, numbers, uconfig, variations, namespace, use, uconfig_no_conversion, u_charset_is_utf8, u_override_cxx_allocation, icu_use_threads, web, exhaustive, mode, with, thread, sanitizer, command, eclipse, public, internal, windows, linux, unix,
Text of the page (most frequently used words):
the (175), icu (75), test (73), for (68), and (68), icu4c (55), that (43), build (42), check (39), this (35), with (35), all (30), source (28), are (26), new (26), run (25), make (24), not (24), icu4j (23), from (22), code (22), files (22), linux (21), samples (21), java (20), file (20), will (17), unicode (16), see (16), use (15), you (15), demos (15), utf (15), class (14), but (14), classes (13), #dependencies (13), tools (13), github (12), release (12), tests (12), line (12), verify (11), then (11), script (11), should (11), data (11), note (11), must (11), which (10), headers (10), global (10), each (9), only (9), default (9), there (9), library (9), header (9), used (9), main (8), set (8), system (8), they (8), windows (8), can (8), delete (8), setup (8), documentation (7), org (7), runconfigureicu (7), these (7), command (7), directory (7), have (7), also (7), any (7), common (7), api (7), google (7), format (7), examples (7), docs (6), clean (6), debug (6), mvn (6), install (6), eclipse (6), following (6), via (6), them (6), sure (6), builds (6), intltest (6), obsolete (6), problems (6), unicodestring (6), uconfig_no_conversion (6), uconfig (6), when (6), need (6), public (6), example (6), uobject (6), imports (6), text (6), endings (6), hierarchies (6), formatting (6), thread (5), disable (5), instructions (5), testing (5), time (5), click (5), sample (5), import (5), grep (5), located (5), charset (5), above (5), has (5), https (5), automatically (5), task (5), icu_use_threads (5), its (5), add (5), before (5), libraries (5), because (5), defined (5), case (5), hdrtst (5), inside (5), folder (5), txt (5), depstest (5), conversion (5), latest (5), properties (5), report (5), just (4), cppflags (4), sanitizer (4), exhaustive (4), project (4), exec (4), get (4), appropriate (4), include (4), demo (4), way (4), machine (4), com (4), docker (4), path (4), pull (4), errors (4), both (4), under (4), change (4), u_override_cxx_allocation (4), show (4), failures (4), automated (4), i18n (4), layout (4), variations (4), integration (4), definitions (4), namespace (4), now (4), other (4), git (4), messages (4), macro (4), including (4), apis (4), some (4), numbers (4), valgrind (4), where (4), memory (4), virtual (4), functions (4), name (4), valid (4), depend (4), group (4), info (4), needed (4), statements (4), jar (4), svn (4), date (4), ascii (4), cldr (4), search (4), healthy (4), uses (3), page (3), top (3), optimized (3), output (3), open (3), workspace (3), src (3), done (3), match (3), methods (3), may (3), calendar (3), instead (3), blob (3), recursive (3), ld_library_path (3), installed (3), bin (3), configuration (3), request (3), using (3), batch (3), option (3), allinone (3), since (3), how (3), want (3), temporarily (3), still (3), sets (3), du_charset_is_utf8 (3), du_using_icu_namespace (3), u_charset_is_utf8 (3), someone (3), constructor (3), section (3), char (3), fix (3), stubdata (3), cannot (3), part (3), like (3), those (3), type (3), without (3), more (3), once (3), one (3), internal (3), depends (3), folders (3), were (3), found (3), ctest (3), longer (3), guarded (3), error (3), coverage (3), static (3), analysis (3), don (3), many (3), mixin (3), destructors (3), old (3), uprv_malloc (3), user (3), guide (3), details (3), implementation (3), non (3), cpp (3), about (3), simple (3), base (3), break (3), complain (3), unistr_cnv (3), string (3), tool (3), remove (3), changes (3), groups (3), keep (3), skip (3), download (3), tmp (3), deps (3), find (3), copy (3), bom (3), characters (3), rtti (3), classid (3), contributors (3), updating (3), collation (3), faq (3), site (2), theme (2), jekyll (2), others (2), http (2), html (2), clang (2), enable (2), fsanitize (2), most (2), compiler (2), required (2), mode (2), right (2), runs (2), application (2), echo (2), dskipits (2), dskiptests (2), detection (2), invokes (2), applications (2), such (2), icu4jweb (2), readme (2), web (2), performed (2), action (2), unix (2), bat (2), successful (2), x86 (2), x64 (2), menu (2), visual (2), studio (2), individually (2), button (2), select (2), solution (2), sln (2), configurations (2), been (2), included (2), explain (2), manually (2), threads (2), disabled (2), 50m1 (2), configure (2), flag (2), possible (2), ticket (2), works (2), setting (2), platform (2), gets (2), definition (2), modify (2), was (2), utypes (2), compilation (2), probably (2), const (2), issues (2), revert (2), value (2), normal (2), changing (2), fine (2), expected (2), built (2), support (2), continuous (2), cases (2), visible (2), empty (2), enabling (2), guard (2), conditionals (2), removed (2), cause (2), unixes (2), information (2), switch (2), below (2), uconfig_no_xxx (2), switches (2), turned (2), look (2), their (2), ignore (2), nor (2), icuplug (2), cxxfiles (2), u_show_cplusplus_api (2), regular (2), compile (2), order (2), prefix (2), temp (2), external (2), releases (2), least (2), running (2), standard (2), fixed (2), boundary (2), inheritance (2), free (2), coding (2), guidelines (2), implementations (2), always (2), operators (2), imported (2), interface (2), umemory (2), means (2), message (2), operator (2), checking (2), icumemcheck (2), sources (2), allocated (2), inherit (2), constructors (2), pure (2), declare (2), requirement (2), ustdio (2), proper (2), allocation (2), might (2), does (2), into (2), function (2), nothing (2), adding (2), symbols (2), try (2), flags (2), likely (2), different (2), unoptimized (2), plug (2), dependency (2), rule (2), around (2), mine (2), between (2), modes (2), organize (2), projects (2), maven (2), python (2), bomfix (2), encoded (2), plain (2), utf8 (2), reports (2), correct (2), job (2), poor (2), man (2), milestone (2), tasks (2), home (2), profiling (2), developers (2), rules (2), synchronization (2), version (2), update (2), measureunit (2), publish (2), custom (2), tries (2), point (2), normalization (2), design (2), rulebasednumberformat (2), services (2), resources (2), locale (2), link (2), edit, 2016, later, inc, license, terms, www, copyright, back, renaming, ldflags, bots, interesting, multithreaded, entire, suite, help, reduce, elapsed, complete, dicu, package, explorer, appears, console, window, choose, pick, ruby, mainclass, read, press, enter, continue, dexec, puts, lane, void, list, execute, giving, results, succeeds, holidays, rbnf, transliterator, working, gui, connect, server, easiest, remote, desktop, executed, ssh, shell, applets, kube, binaries, rebuild, serially, libs, runconfigure, programs, samplecheck, ensure, cleanly, returns, generated, icudt64, dll, stub, 26mb, steps, gha, workflows, triggered, upon, merging, maint, branches, threading, gone, makefile, nearly, important, removes, runtime, 9010, necessary, du_override_cxx_allocation, best, rather, than, earlier, define, hardcoded, breaks, inadvertently, simplest, take, too, toolutil, fail, suites, actions, jobs, outside, refer, qualified, rare, ucol_imp, cintltst, compiling, u_namespace_qualifier, cxxflags, ifndef, u_hide_internal_api, please, reason, location, lkeiely, added, future, available, lives, uconfigtest, exception, regarding, none, completely, travis, atlassian, net, browse, 12141, every, testinternalheaders, simply, stating, particular, straight, tree, level, docmain, icudataver, __cplusplus, users, explicitly, wish, needs, similarly, though, caught, merged, fails, attempt, against, aren, looks, springs, prerequisite, config, export, our, goal, out, 100, grab, insert, executable, ever, lib, ctestfw, leak, discovered, purify, checker, bother, nov, 2004, appear, dozens, reference, here, somewhere, until, pass, 2002, dec, inline, crash, 2581, never, however, called, derive, obj, linkage, currently, pwin32, perl, follow, memcheck, types, uchar, int32_t, pointers, released, uprv_free, struct, structs, scoping, implement, private, prevent, instantiation, members, would, single, model, raw, malloc, realloc, uprv_, versions, remains, techniques, management, customizable, cmemory, passes, takes, require, formattable_cnv, literal, icu_48, symbol, careful, call, printf, usually, thinks, harmless, based, half, stuff, inlined, prints, consider, commit, smaller, fewer, preferable, constructing, first, listed, create, reviewed, markus, scripts, everything, print, specified, actual, twice, slightly, comments, dbg, reasonable, 2019, bot, two, brs, ide, provides, feature, allow, multiple, resolve, wildcard, sort, consistent, experience, oom, problem, your, contain, narrow, selection, per, iteration, course, save, personal, artifact, temporary, xargs, sorting, aosp, cleanup, else, googlejavaformat, stripversion, ntp, true, dmdep, doutputdirectory, dartifact, central, requires, jdk, newer, december, 2024, warning, marked, beginning, signature, byte, sequence, applicable, formerly, over, checked, mime, property, moved, relevant, even, mac, specific, etc, rpil, double, containing, same, repository, phn, bugs, trac, icu4cdocs, style, sheet, next, css, attachment, creates, jenkins, apidocs, trunk, apichangereport, easy, through, uclassid, similar, extending, existing, parent, stable, subclass, uobject_define_no_rtti_implementation, normalizer2, declaration, satisfies, override, after, getdynamicclassid, dummy, contents, local, tooling, configs, monitoring, errorprone, ant, callgrind, configuring, editing, iterator, skipping, known, standards, wip, miscellaneous, maintenance, procedure, legalities, shared, updates, announcements, developing, fuzzer, targets, preparsed, ucd, ucharstrie, bytestrie, structures, cobol, resource, tracing, paragraph, engine, ustream, punctuation, options, customization, architecture, concepts, transform, tutorial, bidi, algorithm, mappings, transforms, trying, final, candidate, messageformat, dates, times, formattedvalue, number, skeletons, rounding, legacy, numberformat, universal, scale, zone, timezone, localizing, locales, compression, converter, stringprep, expressions, unicodeset, utext, characteriterator, iterators, chars, strings, why, service, provider, ins, packaging, building, glossary, posix, migration, basics, internationalization, contacts, mailing, lists, downloading, copied, document, expand, content,
Text of the page (random words):
nd icu4j source files are utf 8 the ascii check is no longer appropriate for them cd icu4c source find name ch or name cpp exec grep phn ascii check source files for valid utf 8 and correct text file line endings verify that all source and text files in the repository have plain lf line endings to do this on linux in an up to date git workspace cd icu icu4c source tools icu file utf8 check py reports problems the same python script from the icu4c tools will also check icu4j cd icu icu4j icu4c source tools icu file utf8 check py to double check the line endings the following grep will find all text files containing r characters do not run from windows where r n line endings are expected cd icu grep rpil r even when run from mac or linux some windows specific files bat etc will be found by this check this is ok check utf 8 file properties obsolete note as of icu 63 the project moved from svn to github svn file properties are no longer relevant note as of icu 59 icu4c source files are utf 8 encoded and have the svn mime type property text plain charset utf 8 they must not have a bom this is checked by the above task check svn properties valid utf 8 and text file line endings the bomfix py script formerly used for this task must not be run over the icu4c sources note this task is only applicable to icu4c icu4j java source files are encoded by utf 8 but must be without utf 8 bom check that the following match files marked as utf 8 vs files beginning with the utf 8 signature byte sequence bom run cd icu icu4c python tools release c bomfix py clean up import statements from command line this can be done from command line using the google java format tool warning requires jdk 17 or newer december 2024 download the latest google java format from maven central mvn dependency copy dartifact com google googlejavaformat google java format latest jar all deps doutputdirectory tmp dmdep stripversion true q ntp cleanup all java files only imports nothing else find type f name java xargs java jar tmp google java format all deps jar i aosp fix imports only skip sorting imports remove the google java format artifact from the temporary folder rm tmp google java format all deps jar you can of course download it from github releases or save it in a personal tools folder and keep it around from eclipse the eclipse ide provides a feature which allow you to organize import statements for multiple files right click on projects source folders files you can select source organize imports which resolve all wildcard imports and sort the import statements in a consistent order note you may experience oom problem when your run this for projects folders which contain many files in this case you may need to narrow a selection per iteration check library dependencies icu 64 2019 done automatically by a build bot at least in one of the two modes debug release ok to skip as brs task we want to keep dependencies between c cpp o files reasonable both between and inside icu s libraries on linux run source test depstest depstest py for example icu mine src icu4c source test depstest depstest py icu mine dbg icu4c do this twice once for a release build optimized and once for a debug build unoptimized they pull in slightly different sets of standard library symbols see comments in dependencies txt if everything is fine the test will print ok specified and actual dependencies match if not get changes reviewed by others including markus including changes in dependencies txt py scripts or icu4c code at first the test will likely complain about o files not listed in its dependencies txt or if files were removed the other way around try to add them to groups or create new groups as appropriate as a rule smaller groups with fewer dependencies are preferable if public api e g constructing a unicodestring via conversion is not needed inside icu e g unistr_cnv make its library depend on its new group if the test prints info group icuplug does not need to depend on platform then the plug in code is disabled as is the default since icu 56 consider enabling it for dependency checking but make sure to revert that before you commit changes there are usually other info messages where the tool thinks that dependencies on system symbols are not needed these are harmless that is don t try to remove them they are needed or not needed based on the compiler flags used if you remove them then you will likely cause an error for someone with different flags also in an unoptimized build you only get half as many info messages you get more in an optimized build because more system stuff gets inlined the test might complain is this a new system symbol we should be careful about adding those for example we must not call printf from library code nor the global operator new the test might complain that some o file imports icu_48 unicodestring unicodestring const char but does not depend on unistr_cnv o this probably means that someone passes a simple string literal or a char into a function that takes a unicodestring which invokes the default conversion constructor we do not want that in most cases such code should be fixed only implementations of api that require conversion should depend on it for example group formattable_cnv depends on group unistr_cnv but then nothing inside icu depends on that verify proper memory allocation functions verify the following for library code common i18n layout ustdio the requirement is for icu s memory management to be customizable by changing cmemory h and the common base class note the requirement remains the techniques to fix issues are valid for testing see the section check library dependencies above no raw malloc free realloc but their uprv_ versions all c classes must inherit the common base class uobject or umemory but not for mixin interface classes pure virtual no data members no constructors because that would break the single inheritance model also not for pure static classes used for name scoping declare but don t implement a private default constructor to prevent instantiation simple struct like c classes and structs that do not have constructors destructors and virtual methods need not inherit the base class but must then be allocated with uprv_malloc all simple types uchar int32_t pointers must be allocated with uprv_malloc and released with uprv_free for testing that this is the case on linux run the perl script icumemcheck pl follow the instructions in the script the script is in in the icu4c sources at source tools memcheck icumemcheck pl also depstest py will show an error message if the global operator new is used see section about checking dependencies for testing that this is the case on windows don t bother as of nov 2004 failures appear in many dozens of files from the mixin class destructors do the check on linux but for reference here are the old instructions make sure that in uobject h uobject new and delete are defined by default currently this means to grep to see that u_override_cxx_allocation is defined to 1 in pwin32 h for windows check the obj s for linkage to the global non uobject operators new delete see uobject cpp for details global new must never be imported global delete will be imported and used by empty virtual destructors in interface mixin classes however they are not called because implementation classes always derive from umemory no other functions must use global delete there are now 2002 dec 17 definitions in utypes h for global new delete with inline implementations that will always crash these global new delete operators are only defined for code inside the icu4c libraries but must be there for all of those see ticket 2581 if a global new delete is used somewhere then change the class inheritance and or use uprv_malloc free until no global new delete are used in the libraries and the tests still pass see the user guide coding guidelines for details run static code analysis tools purify boundary checker valgrind make sure we fixed all the memory leak problems that were discovered when running these tools build icu with debug information on linux runconfigureicu enable debug disable release linux run all of the standard tests under valgrind for intltest for example cd where ever source test intltest ld_library_path lib stubdata tools ctestfw ld_library_path valgrind intltest you can grab the command line for running the tests from the output from make check and then just insert valgrind before the executable check the code coverage numbers our goal is that all releases go out to the public with 100 api test and at least 85 code coverage test icu4c headers test icu4c public headers testing external dependencies in header files on unixes prerequisite configure with prefix icu4c source runconfigureicu linux prefix some temp folder and do make install then set the path so that the installed icu config script can be found export path some temp folder bin path then go to the icu4c test hdrtst directory note not source test hdrtst and do make check this will attempt to compile against each header file individually to make sure there aren t any problems output looks like this if no error springs up all is in order if a c file fails to compile as a c file add it to the cxxfiles txt located in the hdrtst directory as of icu 65 the hdrtst is now run as part of the regular ci builds and the c headers are now guarded with the macro u_show_cplusplus_api there is no longer any cxxfiles txt file instead the public c headers are all guarded with the macro u_show_cplusplus_api which is set to 1 by default if __cplusplus is defined users of icu can explicitly set the macro before including any icu headers if they wish to only use the c apis any new public c header needs to be similarly guarded with the macro though this should be caught in the ci builds for a pull request before it is merged run this test with all the uconfig h variations see below ctest unicode docmain h ctest unicode icudataver h ctest unicode icuplug h test icu4c internal headers run the following script straight from the source tree from inside the source folder not on the top level no need to build nor install for a new release also look for new tools and tests and add their folders to the script you can ignore messages stating that no h files were found in a particular directory the command line is simply git icu icu4c source test hdrtst testinternalheaders sh see https unicode org atlassian net browse icu 12141 every header file should include all other headers if it depends on definitions from them as of icu 68 the internal header test is now automated as part of travis ci test uconfig h variations this test is performed automatically by a github action for each pull request test icu completely and run the header test above with none of the uconfig_no_xxx switches turned on i e the normal case all of the uconfig_no_xxx switches turned on set to 1 for each switch test once with just that one switch on but note the exception regarding uconfig_no_conversion test below see common unicode uconfig h for more documentation there is a script available which will automatically test icu in this way on unixes it lives in tools release c uconfigtest sh see docs at top of script for information when guard conditionals e g ifndef u_hide_internal_api are removed because they cause header test failures please note in the header file the reason that guard conditionals cannot be used in that location or they will lkeiely be re added in the future test c namespace use verify that icu builds without enabling the default use of the icu namespace to test on linux runconfigureicu linux cxxflags du_using_icu_namespace 0 make check any problems will show up as compilation errors when definitions outside the icu c namespace refer to icu c classes those need to be qualified with icu as in icu unicodestring in rare cases a c type is also visible in c code e g ucol_imp h has definitions that are visible to cintltst and then we use u_namespace_qualifier which is defined to be empty when compiling for c the automated build system should have a machine that sets both du_using_icu_namespace 0 and du_charset_is_utf8 1 test uconfig_no_conversion note since icu 73 this test has been included in the github actions continuous integration jobs these instructions explain how to run the test manually make sure that the icu4c common and i18n libraries build with uconfig_no_conversion set to 1 we cannot do this as part of test uconfig h variations because the test suites cannot be built like this but the library code must support it the simplest is to take an icu4c workspace modify uconfig h temporarily by changing the value of uconfig_no_conversion to 1 and do make j l2 5 not make check or make tests verify that the stubdata common i18n libraries build fine layout should build too but toolutil will fail that s expected fix any stubdata common i18n issues revert the uconfig_no_conversion value and verify that it still works with the normal setting if this breaks someone probably inadvertently uses the unicodestring const char constructor see the check library dependencies section test u_charset_is_utf8 verify that icu builds with default charset hardcoded to utf 8 to test on linux runconfigureicu linux cppflags du_charset_is_utf8 1 make j l2 5 check any problems will show up as compilation or test errors rather than setting the cppflags you can also temporarily add define u_charset_is_utf8 1 in unicode platform h before it gets its default definition or modify the default definition there in icu 4 8 and earlier this flag was in unicode utypes h this works best on a machine that is set to use utf 8 as its system charset which is not possible on windows the automated build system should have a machine that sets both du_using_icu_namespace 0 and du_charset_is_utf8 1 test u_override_cxx_allocation 0 verify that icu builds with u_override_cxx_allocation 0 on linux problems will show as build failures cppflags du_override_cxx_allocation 0 runconfigureicu linux make clean make j l2 5 check test icu_use_threads 0 obsolete only necessary up to icu4c 49 icu 50m1 removes icu_use_threads from the runtime code ticket icu 9010 it is still possible to build and test intltest with icu_use_threads 0 but not nearly as important in icu 50m1 the disable threads configure option is gone if you want to test with icu_use_threads 0 then temporarily change this flag in intltest h or in the intltest makefile verify that icu builds and tests with threading disabled to test on linux runconfigureicu linux disable threads make check test icu4c samples and demos windows build and test note since icu 76 this task has been included in the gha workflows which are triggered automatically upon merging with main maint branches these instructions explain how to run the tests manually to build the icu4c samples on windows with visual studio use the following steps open the allinone solution file located under source allinon...
|