Forum Moderators: open

Message Too Old, No Replies

conversion of accented characters

how to do it?

         

starec

4:50 pm on Aug 13, 2001 (gmt 0)

10+ Year Member



If I have a non English site, how do I form dynamic urls from the db records that contain accented characters? Do I have to define some replacement rules character by character, or there are some standards already set and I just need to find them and use them?

Macguru

4:54 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wich DB is it?

starec

5:19 pm on Aug 13, 2001 (gmt 0)

10+ Year Member



mysql 3.22.32

Macguru

5:24 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since you have a pretty standard DB format I wish someone can point you at some existing tool to convert all those accented caracters. I can't since I dont know much about mysql. Wich language is it?

rencke

5:42 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There must be some sort of standardized solution to this. Every single European language except English has this problem. I had it in a site search once, where the DB contained numerous names of people and places containing ü, å, ä and ö. A programmer solved the whole thing with on or two lines of Perl. Let me see if I can get some expert in here to answer this.

You know about the problems with spiders and dynamic url:s, of course?

Bolotomus

6:12 pm on Aug 13, 2001 (gmt 0)

10+ Year Member



I don't see what the problem is, you just have to %-escape the characters right?

Like, if some funky foreign character is a character hex(D8) then you'd say %D8 in your URL, right?

Whether or not the SEs will rank your pages higher because of the "keyword-is-in-the-URL" rule, I don't know.

Macguru

6:16 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A lot of spiders are specifically programmed to run away from such special caracters.

Macguru

6:20 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Starec, could you put field names and record ID in URL?

sugarkane

6:50 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> standards already set

Both Perl and PHP have modules / functions to do this, if they're the language you're using to retrieve the records.

Perl:

use URI::Escape;
$newstring=uri_escape("foobär");

PHP:

$newstring=urlencode("foobär");

In both cases, $newstring would be set to foob%E4r

The commands to reverse this are uri_unescape() and urldecode() respectively.

starec

7:02 pm on Aug 13, 2001 (gmt 0)

10+ Year Member



Sugarcane, great, that's exactly what I was looking for.

Bolotomus, keywords in url help in most of the search engines. Also, it makes the urls more intuitive for the users. What do you prefer more, a url time.com/12,252,14 type or cnn.com/scandals/clinton_levinsky.htm type? :)

Rencke, I have dynamic urls of /category_id/widget_id.htm so the there is no problem with spidering. The new ones will be /category_name/widget_name.htm. Thanks!

rencke

7:57 pm on Aug 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks sugarkane for helping out with this. You are my hero!

Sugarkane is moderating the Server sided scripting forum [webmasterworld.com] here at WebmasterWorld. If you have a particularly baffling problem, he is your man.