Bug #51694 [Asn->Bgs]: Extra characters in strftime %b

From: Date: Thu, 29 Apr 2010 23:19:58 +0000
Subject: Bug #51694 [Asn->Bgs]: Extra characters in strftime %b
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150044@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51694&edit=1

 ID:               51694
 Updated by:       derick@php.net
 Reported by:      mkvirtanen at gmail dot com
 Summary:          Extra characters in strftime %b
-Status:           Assigned
+Status:           Bogus
 Type:             Bug
 Package:          Date/time related
 Operating System: Centos 5.x
 PHP Version:      5.3.2
 Assigned To:      derick

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2010-04-29 09:44:15] 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)





------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51694&edit=1


Thread (3 messages)

« previous php.bugs (#150044) next »