Page 1 of 1
encoding issues
Posted: Wed 5. Nov 2003, 13:10
by marses
Have serious troubles with content encoded as windows-1257.
I suggest using second argument (encoding) of htmlentities as variable which can be set in config, or giving choice to use htmlspecialchars instead (via 'middleware' function or so).
cheers,
Marius
Posted: Wed 5. Nov 2003, 14:41
by Oliver Georgi
I'm sorry. This is not implemented yet. Do you have an idea how to handle this. Maybe I can add new value in conf.inc.php = charset.
Oliver
Posted: Wed 5. Nov 2003, 16:56
by marses
If think so. But then all source files have to be updated adding this new variable to all references to htmlentities.
Frontend + backend files (index.php, phpwcms.php and others that have their own html head) should use this variable encoding as well.
However, multilingual site option should also be considered... so perhaps an array of encodings can be defined to be also accessed as template-tag and/or in user preferences.
Can you estimate when this feature can be implemented? Do you need any help?
cheers,
Marius
Posted: Wed 5. Nov 2003, 17:57
by Oliver Georgi
Maybe it sounds different but it is possible to replace all "htmlentities" with a replacement function that has to be created first.
To insert a new charset var is not difficult.
Any suggestion?
Oliver
Posted: Wed 5. Nov 2003, 18:39
by marses
I'd suggest including $encoding variable to each instance of htmlentities and perhaps quote_style variable as well, set in config. Both having default values if not set. That should be more optimal than using intermediate function.
And the $encoding variable should be used throughout all php files with html heads as well as being available to
reference or
override (for multilingual sites) from templates.
Content forms should also use global or local encoding for individual sections. Though I have no idea how to implement it...

You know the architecture better.
cheers,
Marius[/i]
Posted: Wed 5. Nov 2003, 19:09
by Oliver Georgi
But it seems that there are not all charsets supported.
I will implement this in the next release.
Oliver
Posted: Wed 5. Nov 2003, 19:35
by marses
Thank you for the care!
By the way I was considering creating my own simple CMS and surprisingly came across yours. You've made amazingly simple and yet powerfull CMS.
I have ideas about more useful features, so should I just present them or would it be possible event to contribute some code (which I haven't written yet

)?
Marius
Posted: Wed 5. Nov 2003, 19:56
by Oliver Georgi
Contribution is welcome - but first lets talk about possible improved features. I have also lots of ideas - but time, time, time is the largest problem I have.
Oliver
Posted: Thu 6. Nov 2003, 09:17
by Oliver Georgi
What happens if you insert your chatset encoding in "index.php" line 56:
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
change to
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=win-1257">
Oliver
Posted: Thu 6. Nov 2003, 09:19
by marses
So in my case of unsupported windows-1257 encoding a replacement function is a best solution. In the case of supported encoding it will be normal htmlentities function with second argument while in the case of unsupported one it may be simple htmlspecialchars function.
Regarding multilingual sites.
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
can be removed from frontend's index.php and set in any template even via drop-down list fed from array of encodings.
But would it be possible to have different charset encodings in backend forms?
Marius
Posted: Thu 6. Nov 2003, 09:23
by Oliver Georgi
I have to test this out. Maybe then everything has to be changed to pure unicode isn't it. Then this should not make problems anymore.
But my last message is only to try what happens in the frontend with unchanged backend.
Oliver
Posted: Thu 6. Nov 2003, 09:29
by marses
Yes, unicode.
BTW, I currently removed encoding from index.php and set it in templates as my website will be bilingual.
Marius
Posted: Thu 6. Nov 2003, 09:52
by Oliver Georgi
OK.