Text files are always accessed using a reader, and binary files are always accessed using an InputStream. In a Locale (a system setting that includes the language, number formats, and character set in use) that uses multibyte characters (Japanese, Chinese, Korean), there is a default encoding used to convert bytes into characters. Most text files will be written using this encoding, but sometimes it is necessary to specify the encoding explicitly to use when converting between bytes and characters. For example, in Japan files written on Microsoft Windows usually use the Shift_JIS (SJIS) encoding. Internally, Java always uses the Unicode character set and the UTF-16 encoding. The type of a file parameter (text or binary) can be specified by: fileValue.setDataType(FileValueType.TYPE_TEXT); For binary data use For text files you can also specify the encoding for the data. Specification is necessary only if your files contain characters outside the US-ASCII character set (the standard 7-bit characters used on all Linux computers), and the model can be run on computers that use different character sets or encodings. Unless both of these conditions are true, there is no point in setting the encoding, since ASCII text files are the same in all encodings and a file written in the computer’s default encoding can always be read correctly using the computers default encoding. There is one special encoding “(Automatic Local).” This string
is available in the constant There are actually two encodings for a fileValue.setDataEncoding("SJIS"); fileValue.setReadWriteEncoding(FileValueType.LOCAL_ENCODING); This setting indicates that the data in the handler are encoded using the Shift JIS character set, but the file will be converted into the computer’s default encoding when copying the file into the Working directory. You can see the list of supported encodings on the Files tab of the Design Gateway. You must follow the following procedure to see the list:
|