Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2008, 02:23 PM   #316
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by HarryT View Post
Hi Dale,

The "BookDesigner" program, which many people here use, creates "MobiPocket" books using the TEXt/REAd descriptors in the PRC header. You'll find hundreds of such books on this site.
Yuck, breaking Palm rules is not a good thing. BookDesigner is a mixed blessing at best. I really have a love/hate relationship with that program. Maybe the .pdb extension can help to distinguish real PalmDoc files from those fake BookDesigner ones. There is a clear type for MobiPocket files, it is BOOKMOBI in that field.

Dale
DaleDe is offline   Reply With Quote
Old 02-20-2008, 02:36 PM   #317
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by DaleDe View Post
Yuck, breaking Palm rules is not a good thing. BookDesigner is a mixed blessing at best. I really have a love/hate relationship with that program. Maybe the .pdb extension can help to distinguish real PalmDoc files from those fake BookDesigner ones. There is a clear type for MobiPocket files, it is BOOKMOBI in that field.
Well, the PDB extension will tell you it's a Palm Database. But the content of a Palm Database file can be arbitrary. You need to look at the header record of the file for the REAd creator ID and TEXt type to be sure it's a PalmDOC file.
______
Dennis
DMcCunney is offline   Reply With Quote
Advert
Old 02-20-2008, 03:17 PM   #318
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,977
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
Quote:
Originally Posted by DaleDe View Post
TEXt/REAd should not contain html. Any application doing this should have a different type. This is the PalmDOC format and should never contain any extra stuff or many PalmDOC readers would be broken. Have you seen an example of this and do you know what application created it?
MobiPocket (incorrectly) used TEXt/REAd for its initial PRC format, and I'm pretty sure it contained HTML as well as images.
wallcraft is offline   Reply With Quote
Old 02-20-2008, 03:32 PM   #319
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linkpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by nrapallo View Post
That's it!

Is there a way to use '--rawhtml' and NOT print $text to STDOUT, but rather re-direct (re-open) it internally for the my substitution code to work.

I think what is happening here is that printf to STDOUT in binmode 'actually' generates the para boundaries I want to use. They don't seem to be there when the text is first used i.e my $text = $pdb->text;
Just save it in a variable. "my $rawhtml = $text;" and do it outside the $opt_rawhtml if statement.

binmode is used because Windows add chacacters to the output without it. So the filepos pointer will not be correct so I cannot debug without binmode.
tompe is offline   Reply With Quote
Old 02-20-2008, 05:01 PM   #320
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by DMcCunney View Post
Well, the PDB extension will tell you it's a Palm Database. But the content of a Palm Database file can be arbitrary. You need to look at the header record of the file for the REAd creator ID and TEXt type to be sure it's a PalmDOC file.
______
Dennis
Those two together will probably identify it ok most of the time although I have seen some real PalmDOC files with .prc extensions. It is terrible when software doesn't obey the rules like BD.

Dale
DaleDe is offline   Reply With Quote
Advert
Old 02-20-2008, 05:18 PM   #321
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by DaleDe View Post
Those two together will probably identify it ok most of the time although I have seen some real PalmDOC files with .prc extensions. It is terrible when software doesn't obey the rules like BD.
Ignore the extension and look at the header record in the database.

While all Palm OS programs are PRC files, all PRC files are not programs. Consider Mobipocket, who uses the PRC extension for ebooks on Palm devices. (The Mobi reader doesn't care about the extension, and will find and locate Mobi books with a PDB extension.)

I believe someone once commented that Mobi actually did use the "resource" database format, but I don't recall why.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-20-2008, 05:37 PM   #322
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by tompe View Post
Just save it in a variable. "my $rawhtml = $text;" and do it outside the $opt_rawhtml if statement.

binmode is used because Windows add chacacters to the output without it. So the filepos pointer will not be correct so I cannot debug without binmode.
After 'mobi2html' fixes all the filepos pointers, what if I wanted (need) those Windows characters in the STDOUT output? Could I simulate it using the variable $rawhtml without printf $text?

What is the [char] code that is used in the .pdb (text) for para breaks? It is '\n' in the rawhtml text output to STDOUT.
nrapallo is offline   Reply With Quote
Old 02-20-2008, 06:46 PM   #323
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linkpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by nrapallo View Post
After 'mobi2html' fixes all the filepos pointers, what if I wanted (need) those Windows characters in the STDOUT output? Could I simulate it using the variable $rawhtml without printf $text?

What is the [char] code that is used in the .pdb (text) for para breaks? It is '\n' in the rawhtml text output to STDOUT.
You have misunderstood how it works. The construction to a HTML tree will remove "\n". So the $text variable will contain what you want which is the fixed HTML code (filepos fixed) with "\n" in it. If you just print that string in Windows the "\n" will be converted to the Windows line break convention with two characters.

I assume it is "\n" or "\n\n" that is used for paragraph break. But that is something that must be defined in the original format.

But I do not understan how you can have filepos pointers in something that is not an HTML file.
tompe is offline   Reply With Quote
Old 02-20-2008, 11:06 PM   #324
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by tompe View Post
But I do not understan how you can have filepos pointers in something that is not an HTML file.
You're right, the .pdb text has no filepos pointer; I used that term loosely and 'out of context'.

I will go back and study the 'mobi' part of the code to better understand how $pdb->text gets loaded/created.
nrapallo is offline   Reply With Quote
Old 02-20-2008, 11:30 PM   #325
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by DMcCunney View Post
Ignore the extension and look at the header record in the database.

While all Palm OS programs are PRC files, all PRC files are not programs. Consider Mobipocket, who uses the PRC extension for ebooks on Palm devices. (The Mobi reader doesn't care about the extension, and will find and locate Mobi books with a PDB extension.)

I believe someone once commented that Mobi actually did use the "resource" database format, but I don't recall why.
______
Dennis
I guess you jumped in here without reading the context. The problem we are trying to solve is that a program called Book Designer actually codes the PalmDOC type record in the database into actual MobiPocket files. It is a bad error but we are looking for a work around. We already know how they are supposed to work.

Dale
DaleDe is offline   Reply With Quote
Old 02-21-2008, 02:28 AM   #326
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,548
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by DaleDe View Post
I guess you jumped in here without reading the context. The problem we are trying to solve is that a program called Book Designer actually codes the PalmDOC type record in the database into actual MobiPocket files. It is a bad error but we are looking for a work around. We already know how they are supposed to work.

Dale
The best "workaround" is not to use BD to create MobiPocket books. What I do myself these days is to use BD to create the book and the Sony Reader version of it, then export from BD in HTML format and use "MobiPocket Creator" to create the Mobi-format book. I've written a tutorial describing exactly how to do this in the "Mobi Book Uploads" forum section.
HarryT is offline   Reply With Quote
Old 02-26-2008, 04:26 AM   #327
Ortep
Fanatic
Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.
 
Posts: 527
Karma: 470
Join Date: Sep 2007
Location: The Netherlands
Device: Kindle Oasis
I'm experimenting with mobi2html. Most of the time it looks fine, but sometimes I get really ugly results. The punctuation is replaced by something that looks like high ascii. Is it something I'm doing wrong?

An example:

Quote:
€œSorry, no change, miss,€ the driver said. The girl stared at him, at the dollar, and the coinbox for another moment, and now the driver was beginning to get impatient. €œMiss, are you going to€”€
When I look at the original is is formatted like this:

Quote:
___________“Sorry, no change, miss,” the driver said.__The girl stared at him, at the dollar, and the coinbox for another moment, and now the driver was beginning to get impatient.__“Miss, are you going to—”
(Multiple spaces are replaced by under scores by me because they do not show here)

When I recreate the mobi file the text contains the " €œ" and not the correct punctuation
Ortep is offline   Reply With Quote
Old 02-26-2008, 06:51 AM   #328
Gudy
Wizard
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
That pretty much is the correct punctuation, albeit in UTF-8 encoding. Is the content encoding set correctly in the html file? There should be a line like the following somewhere near the beginning of the file:

Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
If there isn't, it should be considered a bug in mobi2html. If there is, either get a better browser or a tool to convert UTF-8 into something more palatable, like e.g. numeric html entities.
Gudy is offline   Reply With Quote
Old 02-26-2008, 07:30 AM   #329
Ortep
Fanatic
Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.
 
Posts: 527
Karma: 470
Join Date: Sep 2007
Location: The Netherlands
Device: Kindle Oasis
Quote:
Originally Posted by Gudy View Post
That pretty much is the correct punctuation, albeit in UTF-8 encoding. Is the content encoding set correctly in the html file? There should be a line like the following somewhere near the beginning of the file:

Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
If there isn't, it should be considered a bug in mobi2html. If there is, either get a better browser or a tool to convert UTF-8 into something more palatable, like e.g. numeric html entities.
The line isn't there. Inserting it does not help. And can you recommend a better browser? IE6, IE7 and Firefox give exactly the same output. But also Mobicreator does the same when I recreate the mobi file. Even when I force it to use UTF-8. So I guess I'll have to wait what tompe has it say

Last edited by Ortep; 02-26-2008 at 07:33 AM.
Ortep is offline   Reply With Quote
Old 02-26-2008, 08:36 AM   #330
Gudy
Wizard
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Quote:
Originally Posted by Ortep View Post
Inserting it does not help. And can you recommend a better browser? IE6, IE7 and Firefox give exactly the same output.
Hmm, I just checked, and Mozilla, which is essentially the same as Firefox, does the right thing, i.e. it displays crap without that line, and correct punctuation with it. Without it, your browser will use whatever is the default encoding for your platform and locale, which is bound to be CP1250 or similar under Windows and ISO-8859-1 or so under Linux.

I don't know how much HTML you know, so forgive me for perhaps stating the bleeding obvious, but the line must be placed between the <head> and </head> elements in the HTML, It won't work anywhere else. Directly behind the <head> is usually best, just look at the source html for this site for an example (Ctrl-U in Mozilla, I don't know what Firefox uses).
Gudy is offline   Reply With Quote
Reply

Tags
mobi2mobi, mobils


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools Jad Kindle Formats 476 03-15-2015 05:51 PM
Tools for Editing Kindle .mobi Files? GJN Kindle Formats 33 12-26-2013 02:05 PM
Handy Perl Script to convert HTML0 files to smartquotes maggotb0y Sony Reader 0 04-12-2007 11:49 AM
PRS-500 Perl tools to generate Reader content TadW Sony Reader Dev Corner 0 01-08-2007 05:55 AM
gmail copy (gmcp) - Perl script to copy files to/from Gmail Colin Dunstan Lounge 0 09-04-2004 01:24 PM


All times are GMT -4. The time now is 08:22 PM.


MobileRead.com is a privately owned, operated and funded community.