luci-base: cbi.js: fix sfh() hash calculation over multibyte sequences
The C side implementation of the hash operates on bytes while the JS variant
operated on UTF-16 codepoints, leading to miscalculations on input strings
containing multibyte sequences.
Recode the given string to an internal UTF-8 byte representation and
calculate the hash over that.
Fixes client side mapping of translation strings containing non-ASCII
characters.
Signed-off-by:
Jo-Philipp Wich <jo@mein.io>
parent
1ca5a99a
Please register or sign in to comment