utf8_console/
lib.rs

1//! This crate provides a cross-platform function to enable UTF-8 console IO.
2
3use std::io::Error;
4
5#[cfg_attr(unix, path = "unix.rs")]
6#[cfg_attr(windows, path = "windows.rs")]
7mod imp;
8#[cfg(test)]
9mod tests;
10
11/// Enables UTF-8 console IO.
12///
13/// This function does nothing on unix.
14///
15/// On windows, this function sets the input and output code page to UTF-8.
16///
17/// # Example
18///
19/// ```
20/// utf8_console::enable().unwrap();
21/// ```
22pub fn enable() -> Result<(), Error> {
23    imp::enable()
24}