Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

Links

Questions or comments?

Subscribe to our localization mailing list or post a question.

News

The site is undergoing a major overhaul!

We are working hard at a new workflow, that involves translators more directly in the release process. This site plays a major role in the new workflow, so please accept our apologies for the state of the site.

Adding new text encoding to OpenOffice.org

Adding a new text encoding involves a number of modifications, mostly in the sal/textenc source directory (see below). The main benefits of adding a text encoding typically are that you can add it to the drop-down list boxes where you choose a character encoding (e.g., for the "Text Encoded" filter for importing/exporting plain text files, or in the "Tools - Options... - Load/Save - HTML Compatibility" dialog).

The necessary steps include:

  1. Add a new RTL_TEXTENCODING_ to sal/inc/rtl/textenc.h, and update rtl_isOctetEncoding in sal/textenc/tencinfo.c.
  2. In sal/textenc, create a static ImplTextEncodingData instance for the new encoding. If it is a single-byte encoding based on ASCII, you can easily reuse the ImplTextConverter framework that is already in place. You also have to specify corresponding Windows/Unix/MIME character sets, if such exist. If your text encoding is single-byte, your ImplTextEncodingData instance would probably best fit into one of the already existing tcvtXXX1.tab source files (e.g., if your encoding is for Tibetan, it would fit into tcvteas1.tab). Do not forget to add a pointer to your ImplTextEncodingData structure to the aData array in textenc.cxx Impl_getTextEncodingData(). Note that for older versions (OOo1.x SRX645 branch and up to SRC680_m44) this was textenc.c
  3. You should add tests of your new encoding to sal/test/texttestenc.cxx.
  4. To make the new encoding appear in the drop-down list boxes mentioned above, you have:
    1. open an issue for Liz@openoffice.org, write the path of where the string is going to go (for example, "Tools - Options... - Load/Save - HTML Compatibility" dialog) and suggest the new string you want added (in English) and wait for approval for the string as well as the German equivalent from Liz. (If you can suggest the string in German as well that would be helpful.
    2. add both the English and German strings to the resources in svx/source/dialog/txenctab.src file manually; that means directly into the source code.

That said, adding any new text encodings also adds complexity to OpenOffice.org (mostly source and code size in this case), so it should be done only if really necessary (e.g., if there is demand to import/export plain text files encoded in a special encoding; adding a new text encoding would generally not be necessary to just make sure that OpenOffice.org can be localized to some language, or that texts in that language can be written in OpenOffice.org).

If you have any further questions, just ask on our list.

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.