Charset (NotesStream - JavaScript™)
Read-only. Character set used by the external data source.
Defined in
NotesStreamSyntax
getCharset() : string
Usage
Specify the character set for a stream with open.This property
is Unicode
for a new NotesStream
object.
Examples
This button uses Turkish (ISO-8859-4) characters to create a document. To correctly display the document, your machine must be configured to display Unicode in Notes®.var inPath:string = "c:\\turkish.txt";
var charset:string = "ISO-8859-4";
session.setConvertMIME(false);
var inStream:NotesStream = session.createStream();
if (inStream.open(inPath, charset)) {
if (inStream.getBytes() > 0) {
var doc:NotesDocument = database.createDocument();
doc.replaceItemValue("Form", "main");
doc.replaceItemValue("subject", inPath);
var mime:NotesMIMEEntity = doc.createMIMEEntity();
if (mime != null) {
mime.setContentFromText(inStream,
"text/plain; charset=" + charset, NotesMIMEEntity.ENC_NONE);
mime.encodeContent(NotesMIMEEntity.ENC_QUOTED_PRINTABLE);
requestScope.status = "Charset = " + mime.getCharset();
}
doc.save(true, true);
} else requstScope.status = "Input file has no content";
inStream.close();
} else requstScope.status = "Input file open failed";
session.setConvertMIME(true);