move python locale setting to build script to fix docs.rs build
MODIFY
.travis.yml
.travis.yml
@@ -31,7 +31,6 @@ matrix:
env:
global:
- Atlas_ROOT_DIR=/usr/include/ # for cmake to find lapacke.h
- - LC_CTYPE=C.UTF-8 # makes python3 locale.getpreferredencoding() return utf8 encoding instead of ansi
matrix:
- OPENCV_VERSION=3.4.8 WIN_OPENCV_VERSION=3.4.7 OSX_OPENCV_VERSION=@3 OPENCV_PKGCONFIG=opencv CARGO_FEATURES=opencv-34
- OPENCV_VERSION=4.1.2 WIN_OPENCV_VERSION=4.1.1 OSX_OPENCV_VERSION= OPENCV_PKGCONFIG=opencv4 CARGO_FEATURES=opencv-41

MODIFY
build.rs
build.rs
@@ -542,6 +542,7 @@ fn build_wrapper(opencv_header_dir: &PathBuf) -> Result<()> {
.unwrap_or_else(|| PathBuf::from("python3"));
// todo ensure that this is actually python3 (e.g. run --version)
if !Command::new(python3)
+ .env("LC_CTYPE", "C.UTF-8") // makes python3 locale.getpreferredencoding() return utf8 encoding instead of ansi
.args(&["-B", "gen_rust.py", "hdr_parser.py", out_dir_as_str, out_dir_as_str, module, &version])
.args(
files.iter()

move python locale setting to build script to fix docs.rs build