r-lib / tzdb

Time Zone Database Information
https://tzdb.r-lib.org
Other
6 stars 4 forks source link

Implement minimal patch to get `tz.cpp` to work with Windows + Unicode #13

Closed DavisVaughan closed 2 years ago

DavisVaughan commented 2 years ago

Closes #10

This is a minimal ish patch to get date to work with wide character file paths on Windows when one is supplied as the install destination through set_install(const std::string& path).

It mainly required two things:

I don't understand all the details of the streambuf class, but it seems to be working?

Once we have those two helpers, we just use them any time we have to access the path provided by set_install().

gaborcsardi commented 2 years ago

Btw. I think it would make sense to test this on Solaris, and also on a non-UTF-8 Linux, e.g. R-hub has an image, before the release.

DavisVaughan commented 2 years ago

Passing with the test on both Solaris and debian-clang-devel https://builder.r-hub.io/status/tzdb_0.1.2.9000.tar.gz-c681d4eaa6404f87a8b9cadb5406b0d3 https://builder.r-hub.io/status/tzdb_0.1.2.9000.tar.gz-599121d923d842f6b73e346ecb967eeb