Page 1 of 1

ansicpg

Posted: Mon Jul 16, 2007 12:34 pm
by maliger
Hello,

I found some RichView generated RTF files has got \ansicpg0 in their header. The 0 is not valid parametr on this tag (RTF readers do not use CP_ACP as a default).

Also \fcharset1 in font table is not normally written by Word and some RTF readers got a problem with it (like MS RTF->HTML converter).

Regards,
Martin

Posted: Mon Jul 16, 2007 12:53 pm
by Sergey Tkachenko
Ok, \fcharset1 will not be written (\fcharset will be omitted if Charset=DEFAULT_CHARSET).

Does \ansicpg0 cause problems with some RTF readers?

Posted: Mon Jul 16, 2007 1:34 pm
by maliger
Yes, it does. The MS HTML converter emits the
META charset tag to this encoding. I think, every RTF should always got Charset written in its tag. Atleast always, when it contains any character >=0x80 in it.

With \ansicpg0, the MS HTML converter do not emit META Charset at all, which is pretty nice fallback. Perhaps it is application fault that no codepage is set? Can application set that? (TRVStyle.DefCodePage)

I'm sorry - am not good at RV objects, since I'm not direct user of yours. I just consume RV written RTF files...

Thanks for very quick response!
Martin

Posted: Mon Jul 16, 2007 2:05 pm
by Sergey Tkachenko
Yes, TRVStyle.DefCodePage value is used for saving \ansicpg.This problem will be solved if you assign non-zero value to it.

As for me, I think that if code page of document is not defined, the best solution is not saving meta charset in HTML files. I think that making guesses about the document's charset will lead to much worse results.

Yes, I know, the strict standard requires meta charset, but sometimes it is desirable to make universal HTML pages without charsets. For example, I manually removed meta charset from this forum's pages because otherwise it would be very difficult to support Russian subforums (they are hidden from general view).