S h o r t S t o r i e s

// Tales from software development

KindleGen: NCX file must be non-UNICODE

with 2 comments

I’ve been experimenting with creating ebooks using Amazon’s KindleGen. However, everytime I tried to use an NCX file KindleGen (version 1.1) would fail without displaying an error message. If I commented out the reference to the .ncx file in the .opf file then KindleGen successfully created the output file. I tried eveything I could think of with no success and after a couple of hours I gave up.

After sleeping on it I realised that just about the only thing I hadn’t considered was that it might be the file encoding that was causing the problem. So, I opened the .ncx file in Notepad++, set the encoding to UTF-8, and saved it. I edited the .opf file, uncommented the reference to the .ncx file, and then ran KindleGen again. This time it worked!

So, it looks like the .ncx has to be in UTF-8 (or at least in non-UNICODE) format for KindleGen to process it successfully.

Update 30/09/2014

A correction to this post is needed as, as Tom Savage comments below, UTF-8 is UNICODE. The issue is that the NCX file must be a single byte encoding such as UTF-8 rather than a multi-byte encoding such as UTF-16 or UTF-32.

Advertisements

Written by Sea Monkey

October 19, 2010 at 8:00 pm

Posted in Debugging, General

Tagged with ,

2 Responses

Subscribe to comments with RSS.

  1. UTF-8 or Unicode Transformation Format 8 Bit is UNICODE.

    Tom Savagae

    September 27, 2014 at 4:10 pm

    • Tom, you’re absolutely right. What I should have said was that the NCX file needs to be in a recognised 8 bit encoding rather than multi-byte encodings such as UTF-16 and UTF-32.

      Sea Monkey

      September 30, 2014 at 10:32 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: