[fixed] date-field > special char encoding

More
8 years 9 months ago #60471 by kath
hi there,

this is either my mistake or a small bug, dunno:

I had a date-field that rendered wrong special chars in month names (german month name "März" had a diamond char instead of the ~"auml")
Wrapping the display of the month in php: htmlentities( $sMonthName , ENT_COMPAT,'ISO-8859-1', true) fixed it. (from php.net/manual/de/function.htmlspecialchars.php#112476 )

This is in my field config:
FIELD TYPE specific configuration > Date part >
Date format = custom format
Custom format = <empty>
Language filter format = no

Something I did wrong here?

[setup]
fc 3.0.13

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #60481 by ggppdk
Hello

i don't know if this is a bug,
- can you post a picture of the date configuration to reproduce this
- also type the text that you added in custom date format here or is the custom format empty ?
- finally what is "$sMonthName " ?
where (which file) did you put the code :

htmlentities( $sMonthName , ENT_COMPAT,'ISO-8859-1', true)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago - 8 years 9 months ago #60485 by kath

hi George,

1) i attached a picture of my field config
2) the custom format is empty (, not the string "<empty>", but strlen=0 :) )
3) ok, this might be the answer:
$sMonthName comes from:
3.1) $iTimestamp = strtotime($date);
3.2) $sMonthName = strftime('%B',$iTimestamp);
4) i put the code htmlentities( $sMonthName , ENT_COMPAT,'ISO-8859-1', true) into my FC-template

So, this seems to be no bug, but a wrong php-config on my website (; or could FC handle that depending on Joomla's FE-language-setting? Or should Joomla handle that anyway?..)

Ps: Another fix (instead of htmlentities) is
Code:
setlocale(LC_TIME, "de_DE.UTF-8");
Attachments:
Last edit: 8 years 9 months ago by kath.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.369 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline