[MERGE] local weekday support

Martin von Gagern Martin.vGagern at gmx.net
Tue Sep 23 07:02:26 BST 2008

Robert Collins wrote:
> Robert Collins has voted resubmit.
> Status is now: Resubmit
> Comment:
> format_date should either return unicode consistently, or base string
> consistently. If the current behaviour is base string consistently, lets
> add a new function that returns unicode consistently

I believe that the pairing of locale independent date strings with ASCII
strings and of locale dependent date strings with unicode is correct.

Reasons why locale independent dates should be base strings:
* ASCII strings causes less trouble when writing to files or sending
over the net
* Current behaviour is maintained in most parts
* Less likely to rely on automatic conversions

Reasons why locale dependent dates should be unicode strings:
* Keep encoding handling in as few places as possible

This leaves me with several options:

1. have format_date as I had implemented it, but move the unicode
conversion to an extra function, format_date_unicode, to deal with the
encoding. This would add two more possible combinations of locale
dependence and string encoding. I'd rather avoid that, as it is bound to
result in problems for the unintended combinations.

2. Add an extra function format_local_date to do local dates and return
unicode. To avoid code duplication or bad interfaces, both format_date
and format_local_date should then depend on a single private function
doing the common work.

I've chosen the latter approach for the attached bundle. Personally I
can't claim to like the new code better than the previous version I had
submitted here, the one with return type depending on parameters.

> For details, see:
> http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C4871DCA5.9010809%40gmx.net%3E
> Project: Bazaar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: localweekday2.patch
Type: text/x-patch
Size: 7176 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080923/3a79324c/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080923/3a79324c/attachment.pgp 

More information about the bazaar mailing list