Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foreign character conversion

Status
Not open for further replies.

mickjbud

Programmer
Jun 13, 2002
48
GB
Hi all

Server Info

Apache 2.0.54
MYSQL 4.1.11
PHP 4.3.10-16
Linux Debian-4sarge

Working remotely using Windows XP, Locally using similar spec but with Windows XP

My problem is this. I am in the process of upgrading a website which uses a database, I am creating a customized database using information provided from an external database. On this database there are records which contain information in regards to destinations around the world for example:

Country=Foo,Region=Foo etc...



The information taken from the database will be used to form web links as well as been used within the copy of the web page for example:

however this is extremely unsightly and not very good for web spiders indexing my site so using voodoo the link would become:

These links work fine with standard English characters however web browsers don't like foreign characters been put into the address(and most people don't know how to!) so any foreign character is a definite no, no.

Here lies the problem, the database I get from an external source does not provide full standard English equivelant tables/fields. Is there an easy way to create a new table that converts any foreign character into an English equivelant. Languages are English, French, German,Italian,Dutch.

I could code using an array of foreign characters to test and replace each foreign character in a string but this would mean me knowing every foreign character and also how could I convert it back for the database search (how would it know which letters were foreign and which language?)

It seems the easiest and less troublesome way(in the long run) would be to create new tables with Standard English spellings.

Can anybody shed some light on this for me?

All help is welcome and greatly appreciated.

Regards

mick

<a href="<a href="<a href="<a href="
 
So what you want to do is extract information from one database, convert accented characters into their nearest unaccented equivalents, and store the resulting text in another database?

As you suggest, it would depend on your conversion code knowing the unaccented equivalent of each accented character. Well, there may be conversion tables out there somewhere, but since you're just dealing with 5 western languages with presumably the one common character set, it shouldn't be too difficult to do it yourself. The ISO 8859-15 character set, which is probably the one you're dealing with, is described at ; it contains about 70 accented characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top