CHMBuilder inserts BOM

Sep 16, 2009 at 7:41 PM

In this issue http://sandcastle.codeplex.com/WorkItem/View.aspx?WorkItemId=2505 a problem is found and two fixes suggested for the case where the CHMBuilder inserts a BOM character in the file it generates that causes this error in the HHC

HHC4003: Warning: The following option line does not contain an '=' character separating the option and its value: [OPTIONS].

However, this condition only occurs on some systems, apparently responding to some difference in configuration.    Does anyone have any leads on what that configuration might be so that we can avoid the issue rather than having to build a local instance of sandcastle with the fixes (and then build the tools that use Sandcastle, like DocProject)?

Sep 16, 2009 at 8:54 PM
Edited Sep 16, 2009 at 8:57 PM

Hello,
I have said in the work item, the problem is only with the CHM project file (*.hhp), and it occurs on
systems with non-English locale.

>>SHFB:  Does not use the Sandcastle generated CHM project file so you will not experience this.

>>DocProject: I am not very sure. It, however, provides you access to the build process in the
BuildProcess class (may not be correct name, do not have it installed on my current system), so you can
easily open the *.hhp file and save it as I suggested with the work item. You do not need any fix to
the Sandcastle tool to correct this. Something similar to this...(you can directly use StreamReader/StreamWriter).

string fileContent = File.ReadAllText(YourProjectFile);
if (String.IsNullOrEmpty(fileContent) == false)
{
       File.WriteAllText(YourProjectFile, fileContent, new UTF8Encoding(false));
}

>>Sandcastle Assist does not currently use the CHMBuilder.

If you are not using any of those tools, then as I have said: before compiling the CHM file, open the
file and save it with the correct encoding, using the above code.

Best regards,
Paul.

Sep 17, 2009 at 11:49 AM
SelormeyPaul wrote:

Hello,
I have said in the work item, the problem is only with the CHM project file (*.hhp), and it occurs on
systems with non-English locale.

Actually, my system is an American English system that has occasionally been used to develop & test software for non-English locales. If I knew which setting in Windows was causing this behavior in CHMBuilder, I'd change it.

Sep 17, 2009 at 12:57 PM

>>If I knew which setting in Windows was causing this behavior in CHMBuilder, I'd change it.

You do not need to change the system. Just tell me which GUI tool you are currently using,
and I will guide you through it.
If you are not using any GUI tool, just tell me how you are using the Sandcastle.

If you need to verify your system locale, then take a look at the Regional and Language Options
(Region and Language in Win7) in the control panel. In Vista/Win7 it will be the
Administrative tab, in XP the Advanced tab.

Best regards,
Paul.

Sep 22, 2009 at 4:27 PM

when I build the ConceptualExample project provided by the SandCastle install by executing "build_conceptual.bat", I get this error:

C:\Program Files\Sandcastle\Examples\conceptualExample>hhc chm\test.hhp
Microsoft HTML Help Compiler 4.74.8702

Compiling c:\Program Files\Sandcastle\Examples\conceptualExample\chm\test.chm

HHC4003: Warning: The following option line does not contain an '=' character separating the option and its value: [OPTIONS].

but the process does generate a test.chm


My locale is English (US).