How to convert a UNICODE string to ansi in ASP?
Posted on 2009-05-02
We are reading a SQL Server 2000 database and writing its contents out to a text file via our ASP web page.
The problem is that because the fields are defined as ntext, the resulting file is written out as unicode (we're just using the Scripting.FileSystemObject to create a text file and it appears to automatically be saving it as a unicode file).
This is a problem because the 3rd party system we send the text file off to cannot process the unicode data.
We tried casting the SQL field to text (from its original unicode ntext type) but the resulting string was still unicode.
QUESTION: Is there a way in ASP to convert a UNICODE string to ANSI prior to writing it out to the file?