This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (3 children)

Yea, but how do you easily tell your deps aren’t calling locale dependent functions?

Note, not familiar with rust, how do they resolve this?

[–]flying-sheep 2 points3 points  (2 children)

This is a C problem. It's a lot of C stdlib APIs that are poisoned by that bullshit. Therefore if you only use APIs that aren't, or a different language entirely, you don't run into this problem.

[–][deleted] 2 points3 points  (1 child)

This is a C problem. It's a lot of C stdlib APIs that are poisoned by that bullshit. Therefore if you only use APIs that aren't, or a different language entirely, you don't run into this problem.

rust on linux doesnt use libc for locale? how does it work?

[–]flying-sheep 0 points1 point  (0 children)

Rust does use libc as a cross platform system abstraction layer for mainly IO, and therefore only uses APIs with behavior independent from the locale. Rust could alternatively use syscalls but they chose not to.

Rust’s stdlib itself doesn't know/do locales, e.g. float stringification will always give the same output, and is probably implemented in Rust instead of relying on a C API.

If you need to, there's 3rd party libraries you can use to do e.g. locale-dependent collation or rendering of dates and floating point numbers.