php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51694 Extra characters in strftime %b
Submitted: 2010-04-29 09:44 UTC Modified: 2010-04-30 01:19 UTC
From: mkvirtanen at gmail dot com Assigned: derick (profile)
Status: Not a bug Package: Date/time related
PHP Version: 5.3.2 OS: Centos 5.x
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mkvirtanen at gmail dot com
New email:
PHP Version: OS:

 

 [2010-04-29 09:44 UTC] mkvirtanen at gmail dot com
Description:
------------
Creating a date for local (fiFI) format

$dte = strftime("%a, %d %b %Y %H:%M:%S %Z");

adding it to email headers

$headers[] = "Date: $dte";

Results in an extra character after (or in) %b:

Date: ti, 27 huhti� 2010 13:07:18 CDT

The character seems to be chr(240), at least as reported by Amavis and some email systems seem to reject the message (otherwise pure UTF8)




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-30 00:57 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: derick
 [2010-04-30 01:19 UTC] derick@php.net
-Status: Assigned +Status: Bogus
 [2010-04-30 01:19 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is not a bug, for some odd reason the locale for Finnish specifies a non-breaking space behind the month. I get the same output:

derick@kossu:~$ php -r 'setlocale(LC_ALL, "fi_FI.utf8" ); echo strftime("%a, %d %b %Y %H:%M:%S %Z"), "\n";' | hexdump -C
00000000  70 65 2c 20 33 30 20 68  75 68 74 69 c2 a0 20 32  |pe, 30 huhti.. 2|
00000010  30 31 30 20 30 30 3a 31  37 3a 32 39 20 42 53 54  |010 00:17:29 BST|
00000020  0a                                                |.|
00000021

c2 a0 is UTF-8 for character 160, which is the non-breaking space.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 21:01:33 2024 UTC