You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should use wcsftime on Windows, even though it works very
similar to your patch (with the primary difference being that it uses
alloca instead of Py_Malloc).
ocean-city commented on Feb 14, 2009
ocean-citymannequin
MannequinAuthor
More actions
I experimentally implemented with wcsftime, but I couldn't get same
result as strftime + mbcs conversion. Probably because wcsftime depends
on locale.
ocean-city commented on Feb 14, 2009
ocean-citymannequin
MannequinAuthor
More actions
Sorry, if we use wcsftime, I cannot create the patch. On VC6, wcsftime
returns not unicode but mbcs string which copied to wchar array.
Maybe on snakebite.org, I can access VC9 and confirm its behavior on it? ;-)
loewis commented on Feb 14, 2009
loewismannequin
Mannequin
More actions
On VC6, wcsftime simply converts *format* to mbcs string, calls
strftime, and converts result to unicode, so there is no difference
between my patch and wcsftime.
Right.
(Newer VC's wcsftime might have different
implementation though) Maybe you are concerning about the cost of extra
unicode object creation on non-windows platform?
No. I'm concerned primarily about code cleanliness, by relying on
library code rather than implementing stuff ourselves.
OTOH, the conversion to narrow strings still needs to happen on Unix
(and probably needs to use the locale's encoding, not UTF-8), so
a uniform treatment also has a value.
ocean-city commented on Feb 16, 2009
ocean-citymannequin
MannequinAuthor
More actions
Locale is my weak point. :-(
If there is locale encoding function like PyUnicode_DecodeFSDefault for
file system encoding, I think I can use it.
loewis commented on Feb 16, 2009
loewismannequin
Mannequin
More actions
Using TZNAME_ENCODING is fine; I just think it has an incorrect value on
Unix.
All in all, I think the (original) patch is fine, please apply.
ocean-city commented on Feb 16, 2009
ocean-citymannequin
MannequinAuthor
More actions
Thanks, fixed in r69664(py3k) and r69665(release30-maint).
Activity
ocean-city commentedon Feb 13, 2009
On windows, format string should be encoded as mbcs. Otherwise, result
of strftime would be broken. Here is the patch.
loewis commentedon Feb 14, 2009
I think we should use wcsftime on Windows, even though it works very
similar to your patch (with the primary difference being that it uses
alloca instead of Py_Malloc).
ocean-city commentedon Feb 14, 2009
I experimentally implemented with wcsftime, but I couldn't get same
result as strftime + mbcs conversion. Probably because wcsftime depends
on locale.
ocean-city commentedon Feb 14, 2009
Sorry, if we use wcsftime, I cannot create the patch. On VC6, wcsftime
returns not unicode but mbcs string which copied to wchar array.
Maybe on snakebite.org, I can access VC9 and confirm its behavior on it? ;-)
loewis commentedon Feb 14, 2009
Right.
No. I'm concerned primarily about code cleanliness, by relying on
library code rather than implementing stuff ourselves.
OTOH, the conversion to narrow strings still needs to happen on Unix
(and probably needs to use the locale's encoding, not UTF-8), so
a uniform treatment also has a value.
ocean-city commentedon Feb 16, 2009
Locale is my weak point. :-(
If there is locale encoding function like PyUnicode_DecodeFSDefault for
file system encoding, I think I can use it.
loewis commentedon Feb 16, 2009
Using TZNAME_ENCODING is fine; I just think it has an incorrect value on
Unix.
All in all, I think the (original) patch is fine, please apply.
ocean-city commentedon Feb 16, 2009
Thanks, fixed in r69664(py3k) and r69665(release30-maint).