Forums / Setup & design / Special characters

Special characters

Author Message

Karsten Jennissen

Wednesday 21 February 2007 12:02:47 am

Hi,

I am trying to use an URL with a view parameter that contains special characters:

http://stories.kajot.de/finden/firmensitz/(sitz)/M%FCnchen

View parameter should processed in the template as "München", not "M%FCnchen"

How can I retrieve that special character in the template? I have looked for a template operator that searches and replaces characters in a string but there doesn't seem to be one.

Cheers,
Karsten

Matt Brady

Wednesday 21 February 2007 12:30:56 pm

Hi Karsten.
Was just looking through the Forum and thought this interesting as I've experienced the same. However, in this case I cannot recreate the problem.

If I create a URL with the word "München" in it I use the special character %C3%BC rather than %FC and it appears to work ok.

It's not easy being easy.

Karsten Jennissen

Wednesday 21 February 2007 12:38:40 pm

Hi Matt,

thanks for your reply. Click on the link that is in my first post. You will get to my development site. The header you see that beginns with "Firmensitz in ..." uses the view parameter. So you see directly what the variable contains.

I just tried the URL with "München". With Win32/Firefox I get

http://stories.kajot.de/finden/firmensitz/(sitz)/M%FCnchen

With Win32/Internet Explorer 7, the URL shown stays:

http://stories.kajot.de/finden/firmensitz/(sitz)/München

but the variable contains:

..firmensitz/(sitz)/M%C3%BCnchen

Hmm. Partly a browser issue. Nevertheless, I still need a variable in my template that contains "München" with the special character.

Karsten

Matt Brady

Wednesday 21 February 2007 1:34:04 pm

Hi Karsten,
Just tried this by creating a new folder on one of my sites and naming it München (copy and paste rather than using special characters).
It appeared ok on all browsers in the main body but the url read muenchen.

I tried 4 different special character codes and within the body "ü" worked the best... but not in the heading or URL.

Cross browser, cross platform issues, makes me cross ;)

It's not easy being easy.

Claudia Kosny

Wednesday 21 February 2007 1:34:20 pm

Hi Karsten

I am not sure why you get this as it works fine when I test a similar setup here (same view parameter, iso-8859-1 as charset). Maybe this also depends on the encoding of the templates? Anyhow, have you tried to simply url-decode the view parameter?

Claudia

Karsten Jennissen

Wednesday 21 February 2007 1:46:47 pm

Hi Matt,

sorry, I am not sure I understand you. Could you please explain what you did?

Claudia,
urldecode seems exactly what I am looking for but that's a PHP function. How can I use it as a template operator?

Cheers,
Karsten

Claudia Kosny

Wednesday 21 February 2007 1:58:26 pm

Hi Karsten

Urldecode is an easy one as it takes only one parameter:
http://ez.no/ezpublish/documentation/development/kernel/custom_template_operators

Regarding the url - as far as I know the browsers should encode the url, with IE being (of course...) the exception to the rule. So I think you can forget about getting a nice, unencoded url consistently on all browsers. Actually the Firefox html validator complains about a malformed urisequence when you have an unencoded umlaut in the href attribute, although the online validator says it's ok. So confusion all around...

Claudia

Matt Brady

Wednesday 21 February 2007 4:03:49 pm

Hi Karsten,
I wasn't looking at the template so much. More the way it displays in a browser.
I was wondering how 3.9 would handle the different encodings as I had problems with the "&" symbol.
I went into the admin interface and created a new folder and tried naming it:
München (which was just a copy and paste of "München" from this forum)
"M%C3%BCnchen"
"M%FCnchen" (ISO 8859-1 Latin-1 hex code)
"München" (ISO 8859-1 Latin-1 name code)
"München" (ISO 8859-1 Latin-1 number code)

The copy and pasted "München" appeared ok on all browsers in the main body but in the url bar it read as muenchen.

Not sure if this helps at all.

It's not easy being easy.

Karsten Jennissen

Thursday 22 February 2007 7:03:45 am

Hi Matt,

thanks for your clarification. A folder or article with an umlaut is automatically changed to a regular url (München => muenchen). No problem here. I was talking about view parameters. Those are are not changed when they are processed through the template system.

Thanks for all of your help. The urlencode / decode as a template operators work like a charm!

Cheers,
Karsten