-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot open era5-lan nc file. #124
Comments
I am afraid I can't replicate this, I can read this using the example |
Thanks, I use the And I tested on Windows (with msys2) and it fails, but at my linux machine with the same Cargo.toml, it can read it. I'll test more. |
it is the path string encoding problem, I guess. I test under rust 1.74.1 and with msys2 installed.
use netcdf;
fn main() {
let file = "℃.nc";
let _ = netcdf::open(file);
} Then I modified source of netcdf (file.rs) to print output of In Windows: println!("{:?}", f.as_bytes_with_nul()); In Linux: println!("{:?}", f); When When I searched in Unidata's repo and found: Error opening netcdf in path with "special" characters. But I still dont know how to fix it. |
Some special handling of "weird" filenames is included, but for linux only since that is what I have access to. I see python has some encoding handling in [0], maybe we need to add something similar? |
I dont think so. Follow netcdf4-python's code, it just encode string to utf-8, is the same result from for i in "℃.nc".encode("utf-8"):
print(i,",",end="")
#226 ,132 ,131 ,46 ,110 ,99 , btw, if I can read nc file to bytes and open in memory, then no need to deal with the path encoding problem. But I test with |
But what does |
output of |
Error code is
Error: Netcdf(2)
.I tried open with options but no luck, and I can read it from python.
Below is the nc file(zipped to upload to github) I want to read.
2009.01-04.nc.zip
The text was updated successfully, but these errors were encountered: