librehat / kdictionary-lingoes

A Lingoes dictionary file (LD2/LDX) reader/extractor. Written in C++ with Qt
GNU General Public License v3.0
75 stars 29 forks source link

qUncompress: could not allocate enough memory to uncompress data #1

Closed bokuno closed 9 years ago

bokuno commented 10 years ago

I got this: qUncompress: could not allocate enough memory to uncompress data ERROR: Inflated Data is Empty. I'm on a 32-bit + 2GB ram machine with KDE desktop. I downloaded a .ld2 dict file from the lingoes website, and try to output it to a .txt file, but it outputted as above.

librehat commented 10 years ago

what ld2 file did you use?

bokuno commented 10 years ago

Maybe this one : 新日汉大辞典 But, this time I tried, and found that ERROR msg has changed to: qUncompress: Z_DATA_ERROR: Input data is corrupted and I got an output file, but when I tried to open it, my shell just said that it maybe a binary file. Isn't it a text file ? Below I put all I got from my shell: File: newjcdict.ld2 Type: LD2 Version: 2.0 ID: 0x7F854A05 Summary Addr: 1A60 Summary Type: 3 Dictionary Type: 0x3 Index Numbers: 100932 Index Address/Size: 0x1A7C / 403728 B Compressed Data Address/Size: 0x65B7C / 5074111 B Phrases Index Address/Size(Decompressed): 0x0 / 3618880 B Phrases Address/Size(Decompressed): 0x373840 / 5604902 B XML Address/Size(Decompressed): 0x8CBE66 / 15813198 B File Size(Decompressed): 24450 KB Decompressing 1529 data streams. qUncompress: Z_DATA_ERROR: Input data is corrupted Phrases Encoding: UTF-8 XML Encoding: UTF-8 Extracted 361887 entries.

librehat commented 10 years ago

It's the poor encoding detection mechanism that causes this issue.

I'll invest more time to find a decent solution.

bokuno commented 10 years ago

Thanks. Looking forward to it :)

librehat commented 9 years ago

Merry Christmas! Hopefully the lastest code can address your problem.

The automatic detection is still broken sometimes. It can not guess whether the decoded result is correct or not. But I let the application output more information and you can adjust the encoding if it's wrong.

bokuno commented 9 years ago

Thank you for your working! Long time passed before I write this comment, sorry for that :)

librehat commented 9 years ago

Welcome. But you might encounter another issue as described in #5