Saving Australian and other non-US English as RTF
Posted: Thu Jan 12, 2006 6:02 am
We save documents as RTF and want them to follow the Windows Language setting which is English (Australia). This is important as when the RTF document is opened in Word, we want the Australian English spell checker to be used not the English (US) spell checker.
I have coupled TRichViewEdit to ISpell and the LiveSpell checking works correctly - ie it follows my choice of English. I have run the actiontest demo to check if I am doing soemthing wrong but it has the same problem which appears to be that the RTF does not set the deflang, deflangfe and lang tokens: the first two are 0, lang is not set:
The RTF starts {\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0{\fonttbl......
I created an RTF document with Word and got deflang1033 and lang3081 in the stylesheet.
So, I added a SaveRTFExtra proc with the code
if Area=rv_rtfs_Doc then
RTFCode := '\deflang3081\deflangfe3081';
This sort of works - Word opens the document and uses the Australian spell checker but if a change is made and the document is saved then when reopened in TRichView it now thinks the document is US English! Also this solution is not good as I don't like there being two deflang's etc in the RTF header.
Does this problem affect other non-US Englishes?
This is a serious problem for us as we have customers in both the US and Australia using the same software. How do we fix this? I have also tried setting Unicode on the textstyle(0) and saving stylesheets - all to no avail. We are using the very latest version of RV.
I have coupled TRichViewEdit to ISpell and the LiveSpell checking works correctly - ie it follows my choice of English. I have run the actiontest demo to check if I am doing soemthing wrong but it has the same problem which appears to be that the RTF does not set the deflang, deflangfe and lang tokens: the first two are 0, lang is not set:
The RTF starts {\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0{\fonttbl......
I created an RTF document with Word and got deflang1033 and lang3081 in the stylesheet.
So, I added a SaveRTFExtra proc with the code
if Area=rv_rtfs_Doc then
RTFCode := '\deflang3081\deflangfe3081';
This sort of works - Word opens the document and uses the Australian spell checker but if a change is made and the document is saved then when reopened in TRichView it now thinks the document is US English! Also this solution is not good as I don't like there being two deflang's etc in the RTF header.
Does this problem affect other non-US Englishes?
This is a serious problem for us as we have customers in both the US and Australia using the same software. How do we fix this? I have also tried setting Unicode on the textstyle(0) and saving stylesheets - all to no avail. We are using the very latest version of RV.