From 77d32d0ee811a19ca0d9be962ca981ef8278b4ca Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Wed, 1 Feb 2023 15:24:49 +0100 Subject: [PATCH] Fix codec deserialization --- milli/src/heed_codec/script_language_codec.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/milli/src/heed_codec/script_language_codec.rs b/milli/src/heed_codec/script_language_codec.rs index b79ba4897..83e8a7241 100644 --- a/milli/src/heed_codec/script_language_codec.rs +++ b/milli/src/heed_codec/script_language_codec.rs @@ -14,7 +14,8 @@ impl<'a> heed::BytesDecode<'a> for ScriptLanguageCodec { let script = str::from_utf8(s_bytes).ok()?; let script_name = Script::from_name(script); let lan = str::from_utf8(l_bytes).ok()?; - let lan_name = Language::from_name(lan); + // skip '\0' byte between the two strings. + let lan_name = Language::from_name(&lan[1..]); Some((script_name, lan_name)) }