Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Unicode and filestream

Reply
Thread Tools

Unicode and filestream

 
 
ASP
Guest
Posts: n/a
 
      06-15-2005
Why this code doesn't work ? The "testUnicode.asp" file is in Unicode UTF-8
and use the Normalization Form C with the Byte Order Mark (BOM, or Unicode
Signature).

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
<%
Const ForReading = 1, TristateTrue = -1

Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")

Dim objTextStream
Set objTextStream = fso.OpenTextFile(Server.MapPath("testUnicode.asp") ,
ForReading, False, TristateTrue) ' -1 = Open file for reading in unicode

Response.Write(objTextStream.ReadAll)

objTextStream.Close
Set objTextStream = Nothing

Set fso = Nothing
%>
</body>

</html>

Thanks a lot !!!!

J.-Luc


 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      06-15-2005
What does "doesn't work" mean (what are the symptoms)?

I don't think you use a BOM for UTF-8 as it maps unicode into 1-3 bytes not
into 2.

--
--Mark Schupp


"ASP" <> wrote in message
news:%23sU$...
> Why this code doesn't work ? The "testUnicode.asp" file is in Unicode
> UTF-8
> and use the Normalization Form C with the Byte Order Mark (BOM, or Unicode
> Signature).
>
> <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> </head>
>
> <body>
> <%
> Const ForReading = 1, TristateTrue = -1
>
> Dim fso
> Set fso = Server.CreateObject("Scripting.FileSystemObject")
>
> Dim objTextStream
> Set objTextStream = fso.OpenTextFile(Server.MapPath("testUnicode.asp") ,
> ForReading, False, TristateTrue) ' -1 = Open file for reading in unicode
>
> Response.Write(objTextStream.ReadAll)
>
> objTextStream.Close
> Set objTextStream = Nothing
>
> Set fso = Nothing
> %>
> </body>
>
> </html>
>
> Thanks a lot !!!!
>
> J.-Luc
>
>



 
Reply With Quote
 
 
 
 
ASP
Guest
Posts: n/a
 
      06-15-2005
You can see the result of this code at
http://dpel.unilat.org/tests/testUnicode.asp

Any idea ?

J.-Luc

PS.
I use Dreamweaver to create the file testUnicode.asp.


__________________
"Mark Schupp" <> a écrit dans le message de
news:...
> What does "doesn't work" mean (what are the symptoms)?
>
> I don't think you use a BOM for UTF-8 as it maps unicode into 1-3 bytes

not
> into 2.
>
> --
> --Mark Schupp
>
>
> "ASP" <> wrote in message
> news:%23sU$...
> > Why this code doesn't work ? The "testUnicode.asp" file is in Unicode
> > UTF-8
> > and use the Normalization Form C with the Byte Order Mark (BOM, or

Unicode
> > Signature).
> >
> > <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> > "http://www.w3.org/TR/html4/loose.dtd">
> > <html>
> >
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> > </head>
> >
> > <body>
> > <%
> > Const ForReading = 1, TristateTrue = -1
> >
> > Dim fso
> > Set fso = Server.CreateObject("Scripting.FileSystemObject")
> >
> > Dim objTextStream
> > Set objTextStream =

fso.OpenTextFile(Server.MapPath("testUnicode.asp") ,
> > ForReading, False, TristateTrue) ' -1 = Open file for reading in

unicode
> >
> > Response.Write(objTextStream.ReadAll)
> >
> > objTextStream.Close
> > Set objTextStream = Nothing
> >
> > Set fso = Nothing
> > %>
> > </body>
> >
> > </html>
> >
> > Thanks a lot !!!!
> >
> > J.-Luc
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with FileStream and excel Ben ASP .Net 7 07-16-2009 08:45 PM
When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? DR ASP .Net 2 07-29-2008 09:50 AM
When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? DR ASP .Net Building Controls 0 07-29-2008 01:37 AM
Legacy ADODB.Stream and System.IO.Filestream Hawksey ASP .Net 3 11-30-2006 10:05 PM
Unhandled exception in FileStream when writing to a full disk - bug in framework? Amit ASP .Net 8 08-04-2003 03:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57