Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Reading Unicode & Normal Text File

$
0
0
Hi All,

My question is very simple, is it possible to read Unicode text file and normal text file using a one method (CAL Code)?
Version : 2013

Further details:
I read a normal text file in a report, using following method. It works fine.
code
Variables;
name = TextFile data type = File
name = TextLine data type = Text

TextFile.OPEN(TextFileName);
TextFile.READ(TextLine);
code

Then I read a Unicode text file in a report, using following method (because of a client requirement). It works fine.
code
Variables;
name = ReadStream data type = InStream
name = StreamReader data type = DotNet
name = Encoding data type = DotNet


TextFile.CREATEINSTREAM(ReadStream);
StreamReader := StreamReader.StreamReader(ReadStream, Encoding.Unicode);
TextLine := StreamReader.ReadLine;
code

But, a normal text file cannot be read using the method I used for Unicode method.
I need to know, is there a method, which can use to read both normal & Unicode text files.

Thank you.

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>