charset: Add support for calculating bytes occupied by a u16 string
authorSughosh Ganu <sughosh.ganu@linaro.org>
Wed, 6 May 2020 19:12:41 +0000 (22:12 +0300)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 9 May 2020 07:30:28 +0000 (09:30 +0200)
commit4835d35acfabe9fed464602fb919279036a49236
treeb4d2c4524e761d23c23429ff49ac40a93ef2c52c
parent7fec249bb76db8bc21b98c08822116597154704d
charset: Add support for calculating bytes occupied by a u16 string

The current code uses 'u16_strlen(x) + 1) * sizeof(u16)' in various
places to calculate the number of bytes occupied by a u16 string.
Let's introduce a wrapper around this. This wrapper is used on following
patches

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/charset.h
lib/charset.c