REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.63 KB
Close
/proc/thread-self/root/opt/alt/libicu65/usr/share/doc/alt-libicu65-devel/samples/translit/answers/unaccent.cpp
Text
Base64
/*********************************************************************** * © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html#License *********************************************************************** * COPYRIGHT: * Copyright (c) 1999-2002, International Business Machines Corporation and * others. All Rights Reserved. ***********************************************************************/ #include "unaccent.h" /** * Constructor */ UnaccentTransliterator::UnaccentTransliterator() : normalizer("", Normalizer::DECOMP), Transliterator("Unaccent", 0) { } /** * Destructor */ UnaccentTransliterator::~UnaccentTransliterator() { } /** * Remove accents from a character using Normalizer. */ UChar UnaccentTransliterator::unaccent(UChar c) const { UnicodeString str(c); UErrorCode status = U_ZERO_ERROR; UnaccentTransliterator* t = (UnaccentTransliterator*)this; t->normalizer.setText(str, status); if (U_FAILURE(status)) { return c; } return (UChar) t->normalizer.next(); } /** * Implement Transliterator API */ void UnaccentTransliterator::handleTransliterate(Replaceable& text, UTransPosition& index, UBool incremental) const { UnicodeString str("a"); while (index.start < index.limit) { UChar c = text.charAt(index.start); UChar d = unaccent(c); if (c != d) { str.setCharAt(0, d); text.handleReplaceBetween(index.start, index.start+1, str); } index.start++; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
main_1.cpp
2.17 KB
lrw-r--r--
2019-10-03 11:16:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
main_2.cpp
2.63 KB
lrw-r--r--
2019-10-03 11:16:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
main_3.cpp
3.52 KB
lrw-r--r--
2019-10-03 11:16:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
main_4.cpp
3.80 KB
lrw-r--r--
2019-10-03 11:16:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
unaccent.cpp
1.63 KB
lrw-r--r--
2019-10-03 11:16:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
unaccent.h
1.17 KB
lrw-r--r--
2019-10-03 11:16:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).