By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,098 Members | 1,927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,098 IT Pros & Developers. It's quick & easy.

converting data

P: n/a
Hi Gurus

I have a database full of text that I have downloaded from a website (ftp download, read file, parse file (i.e. break it down into
parts), move it into a table, etc...).

My next step now is to load this data into a MySQL database on the net for a PHP website.

HOWEVER, the funny characters on the original website (e.g. unicode characters, etc.... etc...) are doing really nasty things. The
MySQL thaat I use does not support unicode, so I want to reduce it down to just asci characters (to keep it simple).

I have two questions:
a. how do I make sure that all the data in my database are ascii characters?
b. do you agree with my course of action or do you suggest another way?

TIA

- Nicolaas
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"WindAndWaves" <ac****@ngaru.com> wrote in message news:SX*********************@news.xtra.co.nz...
Hi Gurus

I have a database full of text that I have downloaded from a website (ftp download, read file, parse file (i.e. break it down into
parts), move it into a table, etc...).

My next step now is to load this data into a MySQL database on the net for a PHP website.

HOWEVER, the funny characters on the original website (e.g. unicode characters, etc.... etc...) are doing really nasty things. The MySQL thaat I use does not support unicode, so I want to reduce it down to just asci characters (to keep it simple).

I have two questions:
a. how do I make sure that all the data in my database are ascii characters?
b. do you agree with my course of action or do you suggest another way?

TIA

- Nicolaas


If anyone is interested in an answer to this question, I basically did the following to find out where the non-asci characters where
and then replaced them.

function ascionisetable(mytable as string)
dim r as recordset
dim f as field
dim x as string
dim y as long
dim i as long
dim ii as long
dim s as string

set r = currentdb.openrecordset(mytable)
do while not r.eof
for each f in r.fields
s = nz(f.value, "")
ii = len(s)
for i = 1 to ii
x = mid(s,i)
y = ascw(x)
select case y
case is<0, is > 128, 64, 34, 39 'these are special characters in html (e.g. >, <, ", ')
'record and replace (using conversion table
next i
next f
r.movenext
loop
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.