BRL.TextStream: Functions Modinfo Source  

Text streams

The Text Stream module allows you to load and save text in a number of formats: LATIN1, UTF8 and UTF16.

The LATIN1 format uses a single byte to represent each character, and is therefore only capable of manipulating 256 distinct character values.

The UTF8 and UTF16 formats are capable of manipulating up to 1114112 character values, but will generally use greater storage space. In addition, many text processing applications are unable to handle UTF8 and UTF16 files.

Functions

Function LoadText$( url:Object )
ReturnsA string containing the text.
DescriptionLoad text from a stream.
InformationLoadText loads LATIN1, UTF8 or UTF16 text from url.

The first bytes read from the stream control the format of the text:
$fe $fftext is big endian UTF16
$ff $fetext is little endian UTF16
$ef $bb $bftext is UTF8

If the first bytes don't match any of the above values, the stream is assumed to contain LATIN1 text.

Function SaveText( str$,url:Object )
DescriptionSave text to a stream.
InformationSaveText saves the characters in str to url.

If str contains any characters with a character code greater than 255, then str is saved in UTF16 format. Otherwise, str is saved in LATIN1 format.

Module Information

Version1.02
AuthorMark Sibly
LicenseBlitz Shared Source Code
CopyrightBlitz Research Ltd
ModserverBRL
History1.02 Release
HistoryAdded LoadText, SaveText
HistoryFixed UTF16LE=4
History1.01 Release
History1.00 Release
HistoryAdded TextStream module