Microsoft
Software
Hardware
Network
Question : Reading various textfiles according to Encoding
Dear experts,
I work with Delphi2009 which supports unicode.
I am trying to make a CSV importer.
To open a file I use the TextFile, AssignFile(f, filename), reset(f), readln(f, myString), tokenize each line with DelimitedText method of TStringList, CloseFile(f).
However it works only for ANSII text files. If file saved with unicode it doesn't work.
How can I tell the file encoding and perform reading, if file unicode or other encoding transforming readed text to ASCII so I can pass it to TStringList, else if ASCII encoding read it normally and pass ASCII text to TStringList?
In other words universal textfile reader and transform encoded string to wide string or something I can work with. Imported text would ONLY contain normal latin and Greek chars so ASCII is what fits best
Answer : Reading various textfiles according to Encoding
Use this instead
1: 2: 3: 4:
Dim rs As Recordset Set rs = frm.Recordset rs.Delete rs.Requery
Random Solutions
Microsoft Outlook 2007 is pulling duplicate emails from free hotmail live server - how can I prevent this, its driving me mad.
MSExchange ActiveSync Event ID 1040 Annoying?!
Juniper SA2500 SSL VPN and Windows 2008 R2 firewall problem
Crystal Reports 11 (migrating from 8.5) and VB6 using RDO resultset as datasource
IP Address Contention
trying to print to HP laserjet 2050 - and constantly have to hit "ok" button to print
hithavuzu.com why i see they are a referring site
HP-UNIX - compressing/zipping files that are 31GB
Refresh GridView Control
Microsoft PKI Design