I have for some time tried to find a configuration combination for Zenphoto+Zenpage to handle danish chars (æøåÆØÅ) correctly.
I have tried do set $conf['UTF-8'] = false; (zp-config.php) and also setting Charset (within gallery configuration) to 'Western-European (ISO)'
Here the zenphoto+zenpage admin interface is handling the danish chars correctly
But then image album links within 'print_album_menu' fails to print the menu link.
If I do the below fix, the album menu is correct..
zp-core/functions-basic.php:117
/**
* encodes a pre-sanitized string to be used in an HTML text-only field (value, alt, title, etc.)
*
*
@param string $this_string
*
@return string
*/
function html_encode($this_string, $striptags=true) {
if ($striptags) {$this_string = strip_tags($this_string);}
$this_string = htmlspecialchars_decode($this_string, ENT_QUOTES);
//return htmlspecialchars($this_string, ENT_QUOTES, "UTF-8");
return htmlspecialchars($this_string, ENT_QUOTES, "iso-8859-1");
}
If I however uses UTF-8, then I'm having problems with the zenpage admin interface, here the use of the above chars is failing in titles and titlelinks, (comparing to the album handling where the danish chars is handled correctly).
The same goes for the text translation of Zenphoto into danish that I have made, this only fails within the zenpage admin interface.
Hope that I have described the problem in a understandable way...
Is the a way of making zenphoto+zenpage able to handle this correctly, without the above fix in functions-basic.php?
Btw. my danish translation of zenpage is made with UTF-8 set in Poedit.
R:Martin
Comments
Yes I have tried that, and the result is that the char encoding problem is only within the zenpage (not zenphoto) admin gui, here I mean all the admin guidance text, as what I have translated, and then in the title and titlelinks, articl and page content do not suffer any encoding problems. As goes for the remaining part of the zenphoto admin gui, this neither have any encoding problems with danish chars.
So the problem is somehow only related to handling danish chars in the zenpage admin gui, and in zenpage title, titlelink editing.
If I try to type danish chars, in either a article/page title/titlelinks they just disappear..
R:Martin
I tried an page name "Martin's ønskeliste" from your site and that works, too. The titlelink becomes "Martins-oenskeliste" here.
Hummm.
It's not a problem when viewing my page, it's only an issue within the zenpage admin gui...
But of course your right about the titlelink, here they should disappear, but not in the title..
And my danish chars in my publich webpage, has been entered by performing the 'hack' in my first post::
$conf['UTF-8'] = false;
Charset='Western-European (ISO)' (within gallery configuration)
function html_encode($this_string, $striptags=true) {
if ($striptags) {$this_string = strip_tags($this_string);}
$this_string = htmlspecialchars_decode($this_string, ENT_QUOTES);
//return htmlspecialchars($this_string, ENT_QUOTES, "UTF-8");
return htmlspecialchars($this_string, ENT_QUOTES, "iso-8859-1");
}
I was just looking for a way, to come around this..
R:Martin
Your suggestion do not work when I try to keep it all in UTF-8, it do however with my original setup...
$conf['UTF-8'] = false;
Charset='Western-European (ISO)'
What is strange, it that the encoding problem is only within zenpage admin gui on page/article title and in the gui it self..
If I uses danish chars in conection with image part of the gui there is no problems, so album/image text or for that matter content in pages/articles..
I have dropped a couple of screen dumps, on my webpage:
http://www.svendsen-net.dk/blandet/zenphoto/zenphoto-zenpage.jpg.php
To better explain/show my issue.
Anyway thanks for your help and attention, may be it's something in my server setup..
I'l go back to my original setup and include your code change:
return htmlspecialchars($this_string, ENT_QUOTES, getOption('charset'));
Which is a universial fix to my change to the same function..
R:Martin