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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:12:01
Script start
Timing: Jan 18 2025 11:12:01
Module start 'layout'
Timing: Jan 18 2025 11:12:01
Module start 'content'
Timing: Jan 18 2025 11:12:03
Module end 'content'
Timing: Jan 18 2025 11:12:03
Script end

Main resources:

Total runtime1.4780 sec
Peak memory usage4,096.0000 KB
Database Queries77

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.9063152.6250
Module start 'layout' 0.00810.0100 740.531339.4297
Module start 'content' 0.01811.4584 779.9609604.5391
Module end 'content' 1.47650.0014 1,384.500016.8125
Script end 1.4779  1,401.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2476160.0002
Check MTime0.00170.1130160.0001
Mysql Total
Database connection0.00200.131910.0020
Mysqli_queries1.394194.3226770.0181
Looping result0.00090.0576750.0000
Template Total1.426596.520.7132
Template load0.00220.149520.0011
Template processing1.424396.365020.7121
Template load and register function0.00030.019310.0003
states
state_id_array0.00110.077810.0011
state_identifier_array0.00170.117920.0009
Override
Cache load0.00200.1336660.0000
Sytem overhead
Fetch class attribute can translate value0.00110.077530.0004
Fetch class attribute name0.00140.096090.0002
XML
Image XML parsing0.00030.022330.0001
class_abstraction
Instantiating content class attribute0.00000.001090.0000
General
dbfile0.00170.1143100.0002
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs