[OS_Process->SetEncoding] sets the character set which is used for the automatic conversion of data passed to the native process using [OS_Process->Write] and read from the process using [OS_Process->ReadString] or [OS_Process->ReadLine]. By default the encoding is set to UTF-8 if no character set has been set. If a byte stream is passed to [OS_Process->Write] then no encoding is applied and [OS_Process->Read] can be used to read the result of the native process as a raw byte stream.
Var: 'myProcess' = (OS_Process: '/bin/cat');
$myProcess->(SetEncoding: 'iso-8859-1');
$myProcess->(Write: 'This is a test\n');
$myProcess->CloseWrite;
encode_html: $myProcess->ReadString;
$myProcess->Close;
See the Lasso 8 Language Guide for examples of how to use this tag.
Tag Link | [OS_Process->SetEncoding] | Category | OS Process |
---|---|---|---|
Type | Member | Data Source | Any |
Support | Preferred | Version | 8.5 |
Output Type | None | Security | None |
Implementation | Sets | Lasso 8.5 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft