Skip to content
Commit 2babc47a authored by Jo-Philipp Wich's avatar Jo-Philipp Wich
Browse files

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: default avatarJo-Philipp Wich <jo@mein.io>
parent 1ca5a99a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment