Text in Latin 1 Format

BlitzMax Forums/BlitzMax Programming/Text in Latin 1 Format

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes you can store text in latin 1, using TextStreams and setting the apropiate encoding, but Latin1 is not compatible with all characters, so you run the risk of saving wrong text in your files if you use always latin 1. I suggest you to use always unicode big endian (this will save each character in 16 bits, so your filles will be double size of a standar latin 1 file, but you will avoid any incompatibility issue).

The other possibility is check if the data you want to save has any character greater than 255. In that case you have to use unicode, otherwise you can use latin1 safely. (that's the way the SaveText function works)