ARTICLE
File Interfaces and Unicode
As the content of files often reflects the structure of data in the
working memory, the file interface in a
Unicode system must be able to cope
with the following demands:
It must be possible to exchange files between Unicode and non-Unicode
systems.
It must be possible to exchange files between different Unicode systems.
It must be possible to exchange files between different non-Unicode
systems that work with different code pages .
For this reason, in Unicode programs you
must always declare according to which codepage character type the data
that is written in or is read from text files
text file is coded.
You must also take into account that a Unicode program must be
executable in both Unicode and non-Unicode systems. Some syntax rules
have therefore been changed for the file interface in such a way that
the programming of file accessing in Unicode programs is less
error-prone than in non-Unicode programs.
A file must be explicitly opened before every read or write operation.
An open file cannot be opened again. In non-Unicode programs, the first
time a file is implicitly opened, it is opened with the default
settings. The statement to open a file in non-Unicode programs can be
used on files which are already open, although it is not possible to
open a file more than once in the same program.
The type of access and data storage must be explicitly specified when a
file is opened. In non-Unicode systems, a file is opened with the
implicit default settings if no other settings are specified.
When a file is opened to read its content, it is only possible to read
from this file. In non-Unicode programs, it is also possible to write to
files which have been opened in this way.
When a file is opened as text file , only
the content of character-type data objects can be read or written to. In
non-Unicode systems, numerical and byte-type data objects may also be
accessed.
Normally explicit programming is required, where all important
parameters must be entered, rather than programming with default
settings, over which the developer has no influnce. Furthermore,
error-prone mixed forms of byte-type, character-type, and numerical data
is not allowed.
For this reason, it is sensible to keep to the syntax rules for Unicode
programs when using the file interface, even if the system itself is
non-Unicode.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved