$72 GRAYBYTE WORDPRESS FILE MANAGER $21

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/alt-nodejs22/root/usr/share/doc/alt-nodejs22-libicu-devel/samples/translit/

HOME
Current File : /opt/alt/alt-nodejs22/root/usr/share/doc/alt-nodejs22-libicu-devel/samples/translit//unaccent.cpp
/**********************************************************************
 * © 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 "unaccent.h"

const char UnaccentTransliterator::fgClassID = 0;

/**
 * Constructor
 */
UnaccentTransliterator::UnaccentTransliterator() :
    normalizer("", UNORM_NFD),
    Transliterator("Unaccent", nullptr) {
}

/**
 * Destructor
 */
UnaccentTransliterator::~UnaccentTransliterator() {
}

/**
 * Remove accents from a character using Normalizer.
 */
char16_t UnaccentTransliterator::unaccent(char16_t c) const {
    UnicodeString str(c);
    UErrorCode status = U_ZERO_ERROR;
    UnaccentTransliterator* t = const_cast<UnaccentTransliterator*>(this);

    t->normalizer.setText(str, status);
    if (U_FAILURE(status)) {
        return c;
    }
    return static_cast<char16_t>(t->normalizer.next());
}

/**
 * Implement Transliterator API
 */
void UnaccentTransliterator::handleTransliterate(Replaceable& text,
                                                 UTransPosition& index,
                                                 UBool incremental) const {
    UnicodeString str("a");
    while (index.start < index.limit) {
        char16_t c = text.charAt(index.start);
        char16_t d = unaccent(c);
        if (c != d) {
            str.setCharAt(0, d);
            text.handleReplaceBetween(index.start, index.start+1, str);
        }
        index.start++;
    }
}


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
26 Jun 2025 8.36 AM
root / root
0755
answers
--
26 Jun 2025 8.36 AM
root / root
0755
Makefile
0.615 KB
13 Mar 2025 6.31 PM
root / root
0644
README.TXT
3.828 KB
13 Mar 2025 6.31 PM
root / root
0644
main.cpp
3.92 KB
13 Mar 2025 6.31 PM
root / root
0644
translit.sln
1.178 KB
13 Mar 2025 6.31 PM
root / root
0644
translit.vcxproj
7.673 KB
13 Mar 2025 6.31 PM
root / root
0644
translit.vcxproj.filters
1.15 KB
13 Mar 2025 6.31 PM
root / root
0644
unaccent.cpp
1.771 KB
13 Mar 2025 6.31 PM
root / root
0644
unaccent.h
2.873 KB
13 Mar 2025 6.31 PM
root / root
0644
util.cpp
2.245 KB
13 Mar 2025 6.31 PM
root / root
0644
util.h
0.852 KB
13 Mar 2025 6.31 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF