Mutagen-Modding / Mutagen

A .NET library for analyzing, creating, and manipulating Bethesda mods
GNU General Public License v3.0
117 stars 32 forks source link

Fix mismatching strings entry length #495

Closed Elscrux closed 8 months ago

Elscrux commented 9 months ago

Fix mismatching length for encodings where the byte count and string length are different.

I tested this for the Dragonborn book DLC2Book2CommonRavenRock01. Using non-latin languages like Japanese or Russian had their book text cut off roughly in the middle because it was using the string length, not the byte length of the encoding that is used.

Noggog commented 8 months ago

Thanks! Would be nice to have unit tests to back the change, but no worries if you don't have the time. Happy holidays!