FileSystemObject Object in ASP Does Not Handle DBCS

Last reviewed: January 15, 1998
Article ID: Q177382
The information in this article applies to:
  • Microsoft Internet Information Server version 3.0

SYMPTOMS

If a simple ASP page uses the following procedures to read a file and write it to another file:

  1. Create a FileSystemObject object,
2. Open a file using OpenTextFile and assign TristateFalse to “format”
   parameter (ASCII format),
3. Read multiple lines from it using Readline, and 4. Write those lines into another file using Writeline,

then the expected behavior of the above code is that the contents in the output file should be exactly the same as those in the input file. But if the input file is in Double Byte Character String (DBCS) format, the contents of the output file may not be the same as those in the input file.

CAUSE

The OEM (original equipment manufacturer) code page was incorrectly used to convert strings from Unicode to DBCS and vice versa in Scrrun.dll, while the ANSI code page is the right setting used in place of the OEM code page.

WORKAROUND

As a workaround, do the following:

  1. Convert the input file to Unicode format using Notepad.exe.
2. Then assign TristateTrue to “format” parameter of OpenTextFile (Unicode
   format).

-or-

Apply Microsoft Internet Information Server (IIS) version 4.0, which has the fix to the problem.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Internet Information Server version 3.0. The problem has been corrected in IIS 4.0.

Keywords          : iisapi iisscript iisui
Version           : WinNT:3.0
Platform          : winnt
Issue type        : kbbug
Solution Type     : kbpatch


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.