File tree Expand file tree Collapse file tree
icu4c/source/samples/translit/answers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 ***********************************************************************/
1010
1111#include " unicode/translit.h"
12- #include " unicode/rbt.h"
1312#include " unicode/unistr.h"
1413#include " unicode/calendar.h"
1514#include " unicode/datefmt.h"
Original file line number Diff line number Diff line change 99 ***********************************************************************/
1010
1111#include " unicode/translit.h"
12- #include " unicode/rbt.h"
1312#include " unicode/unistr.h"
1413#include " unicode/calendar.h"
1514#include " unicode/datefmt.h"
@@ -43,7 +42,7 @@ int main(int argc, char **argv) {
4342 defFmt->setCalendar (*cal);
4443
4544 // Create a Greek-Latin Transliterator
46- greek_latin = Transliterator::createInstance (" Greek-Latin" );
45+ greek_latin = Transliterator::createInstance (" Greek-Latin" , UTRANS_FORWARD, status );
4746 if (greek_latin == nullptr ) {
4847 printf (" ERROR: Transliterator::createInstance() failed\n " );
4948 exit (1 );
Original file line number Diff line number Diff line change 99 ***********************************************************************/
1010
1111#include " unicode/translit.h"
12- #include " unicode/ rbt.h"
12+ #include " rbt.h"
1313#include " unicode/unistr.h"
1414#include " unicode/calendar.h"
1515#include " unicode/datefmt.h"
@@ -55,16 +55,19 @@ int main(int argc, char **argv) {
5555 defFmt->setCalendar (*cal);
5656
5757 // Create a Greek-Latin Transliterator
58- greek_latin = Transliterator::createInstance (" Greek-Latin" );
58+ greek_latin = Transliterator::createInstance (" Greek-Latin" , UTRANS_FORWARD, status );
5959 if (greek_latin == nullptr ) {
6060 printf (" ERROR: Transliterator::createInstance() failed\n " );
6161 exit (1 );
6262 }
6363
6464 // Create a custom Transliterator
65+ UParseError parseError;
6566 rbtUnaccent = new RuleBasedTransliterator (" RBTUnaccent" ,
6667 UNACCENT_RULES,
6768 UTRANS_FORWARD,
69+ nullptr ,
70+ parseError,
6871 status);
6972 check (status, " RuleBasedTransliterator::ct" );
7073
Original file line number Diff line number Diff line change 99 ***********************************************************************/
1010
1111#include " unicode/translit.h"
12- #include " unicode/ rbt.h"
12+ #include " rbt.h"
1313#include " unicode/unistr.h"
1414#include " unicode/calendar.h"
1515#include " unicode/datefmt.h"
@@ -56,16 +56,19 @@ int main(int argc, char **argv) {
5656 defFmt->setCalendar (*cal);
5757
5858 // Create a Greek-Latin Transliterator
59- greek_latin = Transliterator::createInstance (" Greek-Latin" );
59+ greek_latin = Transliterator::createInstance (" Greek-Latin" , UTRANS_FORWARD, status );
6060 if (greek_latin == nullptr ) {
6161 printf (" ERROR: Transliterator::createInstance() failed\n " );
6262 exit (1 );
6363 }
6464
6565 // Create a custom Transliterator
66+ UParseError parseError;
6667 rbtUnaccent = new RuleBasedTransliterator (" RBTUnaccent" ,
6768 UNACCENT_RULES,
6869 UTRANS_FORWARD,
70+ nullptr ,
71+ parseError,
6972 status);
7073 check (status, " RuleBasedTransliterator::ct" );
7174
Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ using icu::Replaceable;
1313using icu::Transliterator;
1414using icu::UnicodeString;
1515
16+ UOBJECT_DEFINE_RTTI_IMPLEMENTATION (UnaccentTransliterator)
17+
1618/* *
1719 * Constructor
1820 */
1921UnaccentTransliterator::UnaccentTransliterator() :
20- normalizer(" " , Normalizer::DECOMP ),
22+ normalizer(" " , UNORM_NFD ),
2123 Transliterator(" Unaccent" , nullptr ) {
2224}
2325
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ class UnaccentTransliterator : public Transliterator {
2929 */
3030 virtual ~UnaccentTransliterator ();
3131
32+ virtual UClassID getDynamicClassID () const override ;
33+ U_I18N_API static UClassID U_EXPORT2 getStaticClassID ();
34+
3235 protected:
3336
3437 /* *
You can’t perform that action at this time.
0 commit comments