How to get character encoding for netCDF attributes
3 views (last 30 days)
Show older comments
Hello guys,
I have to write global attributes in netCDF files that may contains some special characters (such as "à" and "é" coming from french words). However, the encoding of these characters differ from a system to another. For instance, on my Windows desktop, Matlab seems to encode the characters using Windows-1252 and on a different system on Unix, Matlab writes them in UTF-8 (even if feature('DefaultCharacterSet') return "US-ASCII" in that case). It results that I can get weird characters when I read attributes that were written on an other system.
So, I would like to know if there is a way to know what character encoding Matlab will use (or was used) to write netCDF attributes and if it is possible to select the character encoding to read/write these attributes with Matlab.
1 Comment
Walter Roberson
on 17 Apr 2019
It looks like it is a complicated matter: https://github.com/Unidata/netcdf-c/issues/402
Answers (1)
See Also
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!