Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : MSH_LrsParser does not like my file


Falstaff
01-19-2007, 09:27 AM
When I try to compile the attached file using MSH_LrsParser, I get an EUnicodeReaderReadError. Lrs2lrf will read the file and create an lrf. So, does anyone have any idea what is wrong with my file?

I made the file from a python program. As far as I can tell, there is not really a Uncode problem.

Falstaff

obelix
01-19-2007, 10:50 AM
When I try to compile the attached file using MSH_LrsParser, I get an EUnicodeReaderReadError. Lrs2lrf will read the file and create an lrf. So, does anyone have any idea what is wrong with my file?

I made the file from a python program. As far as I can tell, there is not really a Uncode problem.

Falstaff

Your file contains reference to thumbnail file (image):
<CThumbnail file="1984_thumb.jpeg" />


Parser needs this file to compile the LRF, that is why there is an error.
Last version of parser does not require thumbnail image at all, so if you simply remove the above line from lrs, you will get the LRF without any problems. Alternatively, put "1984_thumb.jpeg" to the folder where you run MSH_LRSParser.

P.S. Also there is some unicode error in the file. You can easily fix it by opening the lrs file in the WordPad and saving it back.

Falstaff
01-19-2007, 12:33 PM
Sorry, I meant to include the jpeg file. I've attached it. Even with the file in the same directory, I get the error message. The same file is compiled by the "regular" lrs2lrf without any errors.

Is there some tag or attribute that the program expects that I don't have that would trigger this error?

Falstaff
01-19-2007, 12:39 PM
Or cou;ld it be related to the location of the file on disk? I have simply copied the parser to a directory on my disk -- does it have to go in a certain location or does it expect other files to be found? In the directions, it said to copy it to a certain subdirectory of the librie software, but I don't have that software...

obelix
01-19-2007, 02:03 PM
Sorry, I meant to include the jpeg file. I've attached it. Even with the file in the same directory, I get the error message. The same file is compiled by the "regular" lrs2lrf without any errors.

Is there some tag or attribute that the program expects that I don't have that would trigger this error?

I cannot get your jpg file.

Do the following:
1. Put in one folder your lrs, the picture (1984_thumb.jpeg) and MSH_LRSParser
2. Open lrs, do nothing but save (to the same name, it will fix the unicode error)
3. run the parser.

I did it myself and it works (I used some replacement to your jpg file)

Falstaff
01-19-2007, 03:41 PM
Thank you for your help. I'd really like to use your parser. The editor I am using saves the exact bytes of the file back -- so I get the same error. Could you post the lrs file after you have saved it so I can see the difference (and generate it correctly in the first place?)

obelix
01-20-2007, 08:02 AM
I found the reason. In one place of the code parser expected #13#10 at the end of the line (actually this is not needed in unicode, just bug of one of the test versions).

Your editor do not put #13 at the end (just #10) that is why there was a problem. When I did open-save, WordPad inserted #13 at the end and problem dissapeared. But it does not work for you, because you are using different editor.

OK, Now I fixed the parser and it does not rely to any nonunicode characters.
Should work now.
www.msh-tools.com/ebook/MSH_LRSParser.zip

Falstaff
01-20-2007, 01:17 PM
Thank you, it works perfectly now. I am testing some pretty large lrs files, so you have saved me a lot of time by making such a fast parser. Plus, now I can use an embedded font!

Thanks again.