473,387 Members | 1,569 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,387 software developers and data experts.

the jungle of text files - CreateTextFile in unicode

Hi Folks

I am wondering if any of you has any experience with unicode files created
from Access.

I am using an access database to write HTML files. Now, for some of these
files, I use Japanese characters, meaning that I have to create a text file
in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True, UniCode(I))
Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as unicode
(yes or no). However, when I then open the resulting HTML file, it shows
nothing. If you go view source in Internet Explorer then you just see about
two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be opened
and read.

TIA

- Nicolaas
Nov 13 '05 #1
3 5341
WindAndWaves wrote:
Hi Folks

I am wondering if any of you has any experience with unicode files created
from Access.

I am using an access database to write HTML files. Now, for some of these
files, I use Japanese characters, meaning that I have to create a text file
in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True, UniCode(I))
Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as unicode
(yes or no). However, when I then open the resulting HTML file, it shows
nothing. If you go view source in Internet Explorer then you just see about
two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be opened
and read.

TIA

- Nicolaas


Since the act of opening/saving in another editor permits the file to be
displayed that indicates there is a difference between what you write
out originally and what is saved. Maybe you don't have an EOF or some
hidden character. What you need is an editor where you can compare the
differences between the two files. Either that, or write a routine to
compare the diffrences. I'll bet you are missing a control character or
something similar.
Nov 13 '05 #2

"Salad" <oi*@vinegar.com> wrote in message
news:Kr*****************@newsread3.news.pas.earthl ink.net...
WindAndWaves wrote:
Hi Folks

I am wondering if any of you has any experience with unicode files created from Access.

I am using an access database to write HTML files. Now, for some of these files, I use Japanese characters, meaning that I have to create a text file in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True, UniCode(I)) Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as unicode (yes or no). However, when I then open the resulting HTML file, it shows nothing. If you go view source in Internet Explorer then you just see about two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be opened and read.

TIA

- Nicolaas


Since the act of opening/saving in another editor permits the file to be
displayed that indicates there is a difference between what you write
out originally and what is saved. Maybe you don't have an EOF or some
hidden character. What you need is an editor where you can compare the
differences between the two files. Either that, or write a routine to
compare the diffrences. I'll bet you are missing a control character or
something similar.


Hi Salad

That is pretty much what I suspected. How do I compare the two though. Do
you know of any programs that literally read the entire file, including the
hidden elements?
Nov 13 '05 #3
WindAndWaves wrote:
"Salad" <oi*@vinegar.com> wrote in message
news:Kr*****************@newsread3.news.pas.earthl ink.net...
WindAndWaves wrote:

Hi Folks

I am wondering if any of you has any experience with unicode files
created
from Access.

I am using an access database to write HTML files. Now, for some of
these
files, I use Japanese characters, meaning that I have to create a text
file
in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True,
UniCode(I))
Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as
unicode
(yes or no). However, when I then open the resulting HTML file, it
shows
nothing. If you go view source in Internet Explorer then you just see
about
two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be
opened
and read.

TIA

- Nicolaas


Since the act of opening/saving in another editor permits the file to be
displayed that indicates there is a difference between what you write
out originally and what is saved. Maybe you don't have an EOF or some
hidden character. What you need is an editor where you can compare the
differences between the two files. Either that, or write a routine to
compare the diffrences. I'll bet you are missing a control character or
something similar.

Hi Salad

That is pretty much what I suspected. How do I compare the two though. Do
you know of any programs that literally read the entire file, including the
hidden elements?


I have an old DOS program called NE (norton editor). You can put 2
files into 2 separate windows and run a compare. It shows the
difference between the two. I know that in one of those SourceSafe type
programs you could do filecompares. You could want to check out
http://www.tucows.com for editors. Also, there might be hex editors
that will show differences.

Hmmm...goto Start/Run and get to DOS by entering Command (Run) and
enter COMP/?
at the DOS prompt

There are some options with COMP that may help you out.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark Anderson | last post by:
Hi, I've a problem with code that should produce a Windows(ANSI) encoded text file but doesn't. Server is IIS 5 on Win 2k, with ASP ver? My ASP uses data from an upstream HTML form on a UTF-8...
8
by: Roomy | last post by:
Guys, I'd love if any of you can help me with this one. I need a script that will take out the words Error, Warning, and Aborted from a 12mb text file and into a new text file after running the...
0
by: caydes | last post by:
Hi guys, i've got a pretty complex problem... it's be great if you can help. i've written an ASP script that uses the CreateTextfile object to create a unicode html file. The html files may...
1
by: watto | last post by:
We have a rather large application built around Access 2k3 which will soon be used for a project in China. The data is exported into CSV files for use by another application. We are just learning...
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
8
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if...
29
by: list | last post by:
Hi folks, I am new to Googlegroups. I asked my questions at other forums, since now. I have an important question: I have to check files if they are binary(.bmp, .avi, .jpg) or text(.txt,...
4
by: Chris | last post by:
I am using the FileSystemOBject for writing text with Unicode as in the example below. When I try to read data from the file with ReadLine, I get "?????????" instead of characters with unicode. ...
1
by: Devin | last post by:
Hi, I'm working with a csv file that contains Chinese characters. IfI drag and drop the csv file into firefox, it displays exactly as I would expect. The English and Chinese characters both...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.