zhumating
zhumating
At first time I lmpatch .lsb file into .ext file, the text is displayed correctly. And I tried to edit the menu of original .lsb. After dump, I find the...
I changed some code in construct\core.py StringEncoded class: ``` def _decode(self, obj, context, path): det = chardet.detect(obj) encoding = det["encoding"] if encoding != None: encoding = encoding.lower() encodings = ["cp932","SHIFT_JIS","ascii",None]...
After I changed _encode in livemaker\lsb\novel.py _TWdCharAdapter class, I successed. ``` def _encode(self, obj, ctx, path): try: result = int.from_bytes(obj.encode("cp936"), byteorder="big") return result except UnicodeEncodeError: return int.from_bytes(obj.encode("cp932"), byteorder="big") ``` ...
I installed construct again and changed line 492 of `livemaker/lsb/core.py` to ``` "Str": construct.Union( construct.PascalString(construct.Int32ul, "cp936"), construct.PascalString(construct.Int32ul, "cp932"), ), ``` then I tried > lmlsb edit 000000CD.lsb 66 and I...
> Hmm, it might be that construct union doesnt work properly with pascalstring, and that to get it to work you'd need to read the length field and then union...
> > > Hmm, it might be that construct union doesnt work properly with pascalstring, and that to get it to work you'd need to read the length field and...