Simple clear advice in plain English

Hands on: Foreign characters

Dealing with letters that have accents and diacritical marks in assorted languages

A particular problem affecting websites is letters that have accents and diacritical marks in assorted languages.

One site I work with has a member directory for a professional organisation. The version on the site shouldn’t really go by a name as grand as a database; it’s essentially a text file, in CSV format, that has been exported from a database in someone’s office and uploaded to the website.

A form on the site allows people to specify what they’re searching for - name, city and so on - and then a Perl script reads through the text file, spitting out an HTML page header, followed by nicely formatted information for the matching entries.

It does the job, but as there are more and more international members, there’s a need to make sure that their names are not only presented correctly on the web page but can be found by searching too.

The first issue is solved by a search and replace each month, swapping single characters in Word for the matching HTML equivalents. For example, ö is changed to ö, and where someone searches for a result that includes that character in, say, the address, then it’s displayed OK.

But how do they search for a name with a foreign character? That needs the script changing to look for the appropriate entity. In PHP that’s a trivial thing to do, with specialised functions that work in both directions, and in Perl a little magic with regular expressions should do the trick.

There’s another problem, though. A lot of words become Anglicised, and with a city such as Paris it makes no difference to the spelling. With others it does - Zurich and Zürich.

You probably need to be consistent when you enter information; either always Anglicise foreign town names, or never. In this case, that means persuading the keepers of the database to change lots of information, which isn’t always possible.

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Security shield illustration

How to use the Command Prompt

Lurking under Windows is the little-known world of the command line. We explain how to use this to fix faults and make your PC much more secure

Blog illustration

Create a Wordpress blog

Blogs are a great way to share news and opinions online. In the first article in our two-part series, we show you how to set one up and update it

337-f3-lp

How to sort lists easily in Word, Excel and Open Office columns

Microsoft Office and Open Office word processing and spreadsheet programs have simple ways of sorting lists of data in tables and spreadsheets

Question & Answer

Q.Why can't my browser find the website address I typed...

> Read the answer

Q.All updates have been downloaded, so why won't Windows...

> Read the answer

Q.How do I stop Windows 7 search?

> Read the answer

Best deals on the web

img

Apple iMac 21.5" (MC309)

£929.00- Buy it now

img

Dell Inspiron 620 ST Intel Core i3-2100 3.10GHz / 3GB / 500GB / DVDRW / Win 7 Home Premium

£299.00- Buy it now

img

Apple iMac 27" (MC813)

£1353.99- Buy it now

Great benefits for subscribers!

Poll

Which is your preferred web browser

Jargon Buster

Computing terms explained in plain English

Restore point

A Windows backup of system files and settings.

Great shopping deals from Computeractive