// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * Copyright (C) 2001-2014, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bocsu.cpp * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * Author: Markus W. Scherer * * Modification history: * 05/18/2001 weiv Made into separate module */ #include "unicode/utypes.h" #if !UCONFIG_NO_COLLATION #include "unicode/bytestream.h" #include "unicode/utf16.h" #include "bocsu.h" /* * encode one difference value -0x10ffff..+0x10ffff in 1..4 bytes, * preserving lexical order */ static uint8_t * u_writeDiff(int32_t diff, uint8_t *p) { … } /* * Encode the code points of a string as * a sequence of byte-encoded differences (slope detection), * preserving lexical order. * * Optimize the difference-taking for runs of Unicode text within * small scripts: * * Most small scripts are allocated within aligned 128-blocks of Unicode * code points. Lexical order is preserved if "prev" is always moved * into the middle of such a block. * * Additionally, "prev" is moved from anywhere in the Unihan * area into the middle of that area. * Note that the identical-level run in a sort key is generated from * NFD text - there are never Hangul characters included. */ U_CFUNC UChar32 u_writeIdenticalLevelRun(UChar32 prev, const char16_t *s, int32_t length, icu::ByteSink &sink) { … } #endif /* #if !UCONFIG_NO_COLLATION */