Character encoding
From FreeMind
Revision as of 15:25, 6 June 2023 by Dan Polansky (talk | contribs)
FreeMind stores Unicode characters as XML character entities into mind map files.
Reading of UTF-8 encoded mind map files is supported, with or without UTF-8 byte order mark (BOM).
Reading of UTF-32BE, UTF-32LE, UTF-16BE and UTF-16LE seem to be all supported provided the mind map starts with byte order mark (BOM).
Writing of UTF-8 is probably not supported; there was a feature request for this.
FreeMind does not write any BOM natively; given it writes XML character entities, it would make no sense.
Implementation
- Class FileReaderCreator in MindMapMapModel uses UTF-8 as the character encoding: 'return new UnicodeReader(new FileInputStream(mFile), "UTF-8");'
- The above class is instantiated in MindMapMapModel.loadTree(final File) method.
- Which is called from MindMapMapModel.load(File file).
- Class UnicodeReader determines the encoding from byte order mark (BOM), if any; it seems to take the passed-in "UTF-8" in case there is no BOM.
Links:
- MindMapMapModel.java, sourceforge.net
- UnicodeReader.java, sourceforge.net
Tracker items
- #860 RC4 regression: incorrect viewing of UTF-8 map, bug, 2010-03-10, sourceforge.net
- #998 Accents in RC11 and RC12, bug, 2010-12-05
- #882 Why not UTF-8 file?, FR, 2015-12-21, sourceforge.net
- #827 saving .mm files in UTF-8, FR, 2012-03-08, sourceforge.net
- #67 Utf-8 aware, and better Chinese characters, patches, 2006-04-07, sourceforge.net -- points to User:Jiangxin/Better chinese characters support
Limitations
- There is no or little support for XML declaration at the top of the mind map file; to be tested and clarified.
- Probably no writing in UTF-8, as per above.