473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Scripting.FileSystemObject Save file Unicode Problem

Hi All,

I have a problem when saving a text file as a html file in unicode and then google index the Unicode bom as well as I can not open these files.

I have a asp page that takes another asp template page and suck some data out of a database, I then create a text file, put this information in there and then save it as a text file except that I change the extenstion to htm.

Basically I create a html file using asp and then save it.

The data from the database contains european language characters and the htm file gets saved as unicode.

I have add the codepage and charset in my asp page as well as in the html file that gets saved.

Now the two problems I have is a sfollows : Google index the page but the cache page shows weired data because it saw this Unicode Bomb that every one is talking about. The second problem, If I try to open the htm file to in my editor, it shows this weired data.

I have read a lot about the char sets and code pages, but I can not seem to get the stuff to work. I am stuck.

I will apreciate any help on this.

Here is my various code sections below in what I am trying to do and I will give you a link to have a look at a page that was created that the view source looks fine, but not in google cache and not in my editor.

CODE :

ASP page that saves the file.

At the top of my ASP page

<%@ CodePage=28592 Language="VBScript"%>
<%
Response.CodePage = 28592
Response.CharSet = "ISO-8859-2"
%>

Then the following

URL = "http://www.imatico.lu/uk/imaticohtmltemplate_golf_properties_all.asp

Set Http = CreateObject("Microsoft.XMLHTTP")

'Send request To URL
Http.Open "GET", URL, False
Http.Send

'Get response data As a string
GetURL = Http.ResponseText

fp = "c:\imatico.lu\uk\mypage.htm"

' first, create the file out of thin air
Set fstemp = server.CreateObject("Scripting.FileSystemObject")
Set filetemp = fstemp.CreateTextFile(fp, fsoForWriting, true)

filetemp.Write GetURL
filetemp.Close

set filetemp=nothing
set fstemp=nothing

This file is now saved as a htm file and seems ok if I use the URL or link to it from another page.

If you download it and open it, it looks like wiered data as well as google index is as follows.

˙ţ < H T M L > < H E A D > < T I T L E > P r o p e r t y f o r ...˙ţ < H T M L > < H E A D > < T I T L E > P r o p e r t y f o r s a l e i n P o r t u g a l < / T I T L E > < m e t a h t t p - e q u i v = C o n t e n t ...
www.imatico.lu/uk/property_Portugal1.htm - 66k - Cached - Similar pages


Any help please ?????

Thanks in advance

Hugo
Jul 11 '07 #1
1 8339
Hi All,

I have a problem when saving a text file as a html file in unicode and then google index the Unicode bom as well as I can not open these files.

I have a asp page that takes another asp template page and suck some data out of a database, I then create a text file, put this information in there and then save it as a text file except that I change the extenstion to htm.

Basically I create a html file using asp and then save it.

The data from the database contains european language characters and the htm file gets saved as unicode.

I have add the codepage and charset in my asp page as well as in the html file that gets saved.

Now the two problems I have is a sfollows : Google index the page but the cache page shows weired data because it saw this Unicode Bomb that every one is talking about. The second problem, If I try to open the htm file to in my editor, it shows this weired data.

I have read a lot about the char sets and code pages, but I can not seem to get the stuff to work. I am stuck.

I will apreciate any help on this.

Here is my various code sections below in what I am trying to do and I will give you a link to have a look at a page that was created that the view source looks fine, but not in google cache and not in my editor.

CODE :

ASP page that saves the file.

At the top of my ASP page

<%@ CodePage=28592 Language="VBScript"%>
<%
Response.CodePage = 28592
Response.CharSet = "ISO-8859-2"
%>

Then the following

URL = "http://www.imatico.lu/uk/imaticohtmltemplate_golf_properties_all.asp

Set Http = CreateObject("Microsoft.XMLHTTP")

'Send request To URL
Http.Open "GET", URL, False
Http.Send

'Get response data As a string
GetURL = Http.ResponseText

fp = "c:\imatico.lu\uk\mypage.htm"

' first, create the file out of thin air
Set fstemp = server.CreateObject("Scripting.FileSystemObject")
Set filetemp = fstemp.CreateTextFile(fp, fsoForWriting, true)

filetemp.Write GetURL
filetemp.Close

set filetemp=nothing
set fstemp=nothing

This file is now saved as a htm file and seems ok if I use the URL or link to it from another page.

If you download it and open it, it looks like wiered data as well as google index is as follows.

˙ţ < H T M L > < H E A D > < T I T L E > P r o p e r t y f o r ...˙ţ < H T M L > < H E A D > < T I T L E > P r o p e r t y f o r s a l e i n P o r t u g a l < / T I T L E > < m e t a h t t p - e q u i v = C o n t e n t ...
www.imatico.lu/uk/property_Portugal1.htm - 66k - Cached - Similar pages


Any help please ?????

Thanks in advance

Hugo
Here is the example.....

Type this is google : property_portugal1.htm

You get the above problem. but click on the link it takes you to the page.

Thanks

Hugo
Jul 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fedroz | last post by:
Hi! Here is my problem: I'm trying a simple script copied by MSDN for read a text file and put the content on output web page! I use the following code: Const ForReading = 1, ForWriting = 2,...
3
by: bt | last post by:
I am just beginning with asp and have gotten an error that I need some help with. I posted a pair of files to an online ASP host server. The files are in the same directory; one is readfile.asp...
2
by: John | last post by:
Can't get this to work. I'm creating a workaround for the absence of aspJPEG on my server. I'm using aspUpload but my server only uses aspThumb. After aspThumb optimizes the original pic the file...
5
by: VancouverMike | last post by:
Hi there, I am writing a web app using asp.net 1.1 and C#. This web app is launched in another win32 application and this app needs to pass information to my web app. But this win32 application...
1
by: pbd22 | last post by:
Hi - I have code that automatically fills tabs on a page. In some cases, a URL path won't be correct (the folder and files don't exist) and, in these cases, I want to catch these exceptions and...
7
ADezii
by: ADezii | last post by:
The next series of Tips will involve the Microsoft Scripting Runtime Library (Scrrun.dll). This Library is, in my humble opinion, one of the most useful and practical Libraries ever created. With the...
0
ADezii
by: ADezii | last post by:
This is the 2nd Tip in a series of Tips on the Microsoft Scripting Runtime Library. The 1st Tip related to Drives, while this Tip will concentrate on the Folders (Directories) in your PC and various...
0
ADezii
by: ADezii | last post by:
This is the 3rd in a series of Tips dealing specifically with the Microsoft Scripting Runtime Library. In this Tip, we'll show you how to return specific Properties relating to Files, as well as...
0
ADezii
by: ADezii | last post by:
This is the last in a series of Tips involving the Microsoft Scripting Runtime Library and deals with creating, opening, writing to, reading from, and closing Text Files via this Library. At this...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.