[MAGNOLIA-3286] Add new setting URLEscapingCharset to the freemarker config Created: 31/Aug/10 Updated: 06/Dec/13 Resolved: 06/Dec/13 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | freemarker |
| Affects Version/s: | 4.3.6 |
| Fix Version/s: | 4.5.11, 5.1 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Bert Leunis | Assignee: | Ondrej Chytil |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Patch included: |
Yes
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Description |
|
Since Freemarker 2.3.1 a new built-in exists: ?url for url escaping: see http://freemarker.sourceforge.net/docs/ref_builtins_string.html#ref_builtin_url. For this built-in to work the charset has to be set. That can be done in tree ways: 1. as a parameter of the built-in itself: ${x?url('UTF-8')} The patch added takes care of option 3. |
| Comments |
| Comment by Bert Leunis [ 31/Aug/10 ] |
|
Further ways to make the freemarker config in magnolia more flexible and configurable were described by Grégory on the userlist:
Option three gives the most freedom, but takes more time to build. |
| Comment by Magnolia International [ 01/Sep/10 ] |
|
Is UTF-8 the good default for url encoding? I'm not sure why it even needs to be specified; isn't that supposed to be the encoding of the source files (.ftl) ? and/or of the variable it uses ? |
| Comment by Fabrizio Giustina [ 01/Sep/10 ] |
The default for url encoding is ISO-8859-1. Using UTF-8 is better but you usually have to configure the application server appropriately before, using UTF-8 with the default configuration may lead to strange results. (Speaking about tomcat, you have to set the encodingURI on the connector and the "forward request unparsed" thing on the apache side). So, utf-8 is definitively the best default for people that need extended chars in URLs but it also requires some tweak on the environment, not sure if everybody is aware of that. |
| Comment by Magnolia International [ 10/Jan/11 ] |
|
Can we get this into 4.4.2 with the value configured under /server/rendering/freemarker ? |
| Comment by Philipp Bärfuss [ 18/Jan/11 ] |
|
We are finalizing 4.4.2 hence I am moving this issue to 4.4.3. |
| Comment by Magnolia International [ 06/Dec/13 ] |
|
Fixed with |