$59 GRAYBYTE WORDPRESS FILE MANAGER $39

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/libicu/usr/share/doc/alt-libicu-devel/samples/translit/

HOME
Current File : /opt/alt/libicu/usr/share/doc/alt-libicu-devel/samples/translit//unaccent.cpp
/**********************************************************************
 * © 2016 and later: Unicode, Inc. and others.
 * License & terms of use: http://www.unicode.org/copyright.html#License
 **********************************************************************
 **********************************************************************
 * 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", 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++;
    }
}


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.40 PM
root / root
0755
answers
--
3 Mar 2024 10.40 PM
root / root
0755
Makefile
0.623 KB
17 Apr 2019 7.42 PM
root / root
0644
README.TXT
3.831 KB
17 Apr 2019 7.42 PM
root / root
0644
main.cpp
3.922 KB
17 Apr 2019 7.42 PM
root / root
0644
translit.sln
1.178 KB
17 Apr 2019 7.42 PM
root / root
0644
translit.vcxproj
9.353 KB
17 Apr 2019 7.42 PM
root / root
0644
translit.vcxproj.filters
1.15 KB
17 Apr 2019 7.42 PM
root / root
0644
unaccent.cpp
1.735 KB
17 Apr 2019 7.42 PM
root / root
0644
unaccent.h
2.896 KB
17 Apr 2019 7.42 PM
root / root
0644
util.cpp
2.244 KB
17 Apr 2019 7.42 PM
root / root
0644
util.h
0.859 KB
17 Apr 2019 7.42 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF