Dual-Life / Time-Piece

Object Oriented time objects
Other
15 stars 33 forks source link

Localized date does not have utf-8 flag #61

Open Yenya opened 2 years ago

Yenya commented 2 years ago

TIme::Piece->strftime() does not return UTF-8 data, unlike POSIX::strftime(). I think it should behave the same way.

Proof of concept code, run with LC_TIME=cs_CZ.UTF-8, ja_JP.UTF-8 or any other locale which uses non-ascii leters in month names:

strftime.pl.txt

This is probably related to https://rt.cpan.org/Public/Bug/Display.html?id=97539

FGasper commented 2 years ago

I doubt this can be changed since it would break applications that depend on the current behaviour.

It probably just needs to be documented: whereas POSIX::strftime() returns characters, this module’s strftime() returns bytes.

FGasper commented 2 years ago

Notably, both seem to behave the same in a non-UTF-8 locale (e.g., ru_RU.koi8r).