21 Sep, 2019

1 commit

  • u16 version of strcmp(): u16_strncmp() works like u16_strcmp() but only
    at most n characters (in u16) are compared.
    This function will be used in my UEFI secure boot patch.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     

17 Jul, 2019

1 commit


13 May, 2019

1 commit


13 Feb, 2019

1 commit


24 Sep, 2018

5 commits

  • Up to now the EFI_TEXT_INPUT_PROTOCOL only supported ASCII characters.
    With the patch it can consume UTF-8 from the console.

    Currently only the serial console and the console can deliver UTF-8.
    Local consoles are restricted to ASCII.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Provide functions for upper and lower case conversion.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Remove functions:
    - utf8_to_utf16()
    - utf16_strcpy()
    - utf16_strdup()

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • utf8_get() - get next UTF-8 code point from buffer
    utf8_put() - write UTF-8 code point to buffer
    utf8_utf16_strnlen() - length of a utf-8 string after conversion to utf-16
    utf8_utf16_strncpy() - copy a utf-8 string to utf-16
    utf16_get() - get next UTF-16 code point from buffer
    utf16_put() - write UTF-16 code point to buffer
    utf16_strnlen() - number of codes points in a utf-16 string
    utf16_utf8_strnlen() - length of a utf-16 string after conversion to utf-8
    utf16_utf8_strncpy() - copy a utf-16 string to utf-8

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The function names utf16_strlen() and utf16_strnlen() are misnomers.
    The functions do not count utf-16 characters but non-zero words.
    So let's rename them to u16_strlen and u16_strnlen().

    In utf16_dup() avoid assignment in if clause.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

11 May, 2018

1 commit

  • As part of the main conversion a few files were missed. These files had
    additional whitespace after the '*' and before the SPDX tag and my
    previous regex was too strict. This time I did a grep for all SPDX tags
    and then filtered out anything that matched the correct styles.

    Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
    Reported-by: Heinrich Schuchardt
    Signed-off-by: Tom Rini

    Tom Rini
     

01 Dec, 2017

1 commit


10 Oct, 2017

1 commit

  • The constant MAX_UTF8_PER_UTF16 is used to calculate
    required memory when converting from UTF-16 to UTF-8.
    If this constant is too big we waste memory.

    A code point encoded by one UTF-16 symbol is converted to a
    maximum of three UTF-8 symbols, e.g.

    0xffff could be encoded as 0xef 0xbf 0xbf.
    The first byte carries four bits, the second and third byte
    carry six bits each.

    A code point encoded by two UTF-16 symbols is converted to four
    UTF-8 symbols.

    So in this case we need a maximum of two UTF-8 symbols per
    UTF-16 symbol.

    As the overall maximum is three UTF-8 symobls per UTF-16 symbol
    we need MAX_UTF8_PER_UTF16 = 3.

    Fixes: 78178bb0c9d lib: add some utf16 handling helpers
    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

13 Sep, 2017

1 commit