Documentation/Calc Functions/UNICODE

    From The Document Foundation Wiki
    Other languages:


    Function name:

    UNICODE

    Category:

    Text

    Summary:

    Determines the Unicode code point that corresponds to the first character of a given text string or number.

    The UNICODE function is complementary to the UNICHAR function.

    For some characters with code points in the range 0 ≤ n ≤ 255, UNICODE may return the same code point as the CODE function. However, for other characters with code points in the same range, the value returned by UNICODE may be different from that returned by CODE. This difference arises when CODE returns the code point for a system-specific character from the current coded character set.

    Syntax:

    UNICODE(Text)

    Returns:

    Returns an integer in the range 0 ≤ n ≤ 111411 (0x10FFF in hexadecimal), which is the Unicode code point that corresponds to the first character of the given text string or number.

    Arguments:

    Text is a text string (in quotation marks) or a number, or a reference to a cell containing such a string or number, the first character of which is the character whose code point is to be determined.

    • If Text is an empty string, then UNICODE reports Err:504 (error in parameter list).
    • If Text is a non-negative number, then UNICODE returns the code point corresponding to the first digit of that number. If Text is a negative number, then UNICODE returns the code point corresponding to the minus sign (which has a Unicode code point of 45).

    Additional details:

    For any code point n, n = UNICODE(UNICHAR(n))

    Examples:

    Formula Description Returns
    =UNICODE("Hieronymus") Here the function returns the value 72, which is the Unicode code point for uppercase "H". 72
    =UNICODE("hieroglyphic") Here the function returns the value 104, which is the Unicode code point for lowercase "h". 104
    =UNICODE(D1) where cell D1 contains a semicolon (";") character. Here the function returns the value 59, which is the Unicode code point for the semicolon. 59
    =UNICODE(-345.678) Here the function returns the value 45, which is the Unicode code point for the minus sign. 45
    =UNICODE(23.4) Here the function returns the value 50, which is the Unicode code point for the digit "2". 50
    =UNICODE("∰") Here the function returns the value 8752 (0x2230 in hexadecimal), which is the Unicode code point for the mathematical symbol for a volume integral. 8752
    =UNICODE("🙂") Here the function returns the value 128578 (0x1F642 in hexadecimal), which is the Unicode code point for the the "slightly smiling face" emoticon. 128578

    Related LibreOffice functions:

    CHAR

    CODE

    UNICHAR

    ODF standard:

    Section 6.20.26, part 2

    Related (or similar) Excel functions:

    UNICODE since v.2013.