encoding issues

Use GitHub to post feature requests for phpwcms.
Locked
marses
Posts: 26
Joined: Wed 5. Nov 2003, 09:53
Location: Dorking, England

encoding issues

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
marses
Posts: 26
Joined: Wed 5. Nov 2003, 09:53
Location: Dorking, England

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
marses
Posts: 26
Joined: Wed 5. Nov 2003, 09:53
Location: Dorking, England

Post 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]
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

But it seems that there are not all charsets supported.
I will implement this in the next release.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
marses
Posts: 26
Joined: Wed 5. Nov 2003, 09:53
Location: Dorking, England

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
marses
Posts: 26
Joined: Wed 5. Nov 2003, 09:53
Location: Dorking, England

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
marses
Posts: 26
Joined: Wed 5. Nov 2003, 09:53
Location: Dorking, England

Post by marses »

Yes, unicode.

BTW, I currently removed encoding from index.php and set it in templates as my website will be bilingual.

Marius
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

OK.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Locked