utf-8: added README section

pull/42/head
Vladimir Serov 2020-02-09 16:24:59 +03:00
parent ec6b09e319
commit f2f82485dc
No known key found for this signature in database
GPG Key ID: 6BA7C26C3FDF7BB3
1 changed files with 36 additions and 1 deletions

View File

@ -108,4 +108,39 @@ fn main() {
Generates this SVG:
[![Output](src/test_annex_i_micro_qr_as_svg.svg)](src/test_annex_i_micro_qr_as_svg.svg)
[![Output](src/test_annex_i_micro_qr_as_svg.svg)](src/test_annex_i_micro_qr_as_svg.svg)
## Unicode string generation
```rust
use qrcode::QrCode;
fn main() {
let code = QrCode::new("mow mow").unwrap();
let image = code.render::<u8>()
.dark_color(0)
.light_color(1)
.build();
println!("{}", image);
}
```
Generates this output:
```
█████████████████████████████
█████████████████████████████
████ ▄▄▄▄▄ █ ▀▀▀▄█ ▄▄▄▄▄ ████
████ █ █ █▀ ▀ ▀█ █ █ ████
████ █▄▄▄█ ██▄ ▀█ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ ▀▄▀ █▄▄▄▄▄▄▄████
████▄▀ ▄▀ ▄ █▄█ ▀ ▀█ █▄ ████
████▄██▄▄▀▄▄▀█▄ ██▀▀█▀▄▄▄████
█████▄▄▄█▄▄█ ▀▀▄█▀▀▀▄█▄▄████
████ ▄▄▄▄▄ █ ▄▄██▄ ▄ ▀▀████
████ █ █ █▀▄▄▀▄▄ ▄▄▄▄ ▄████
████ █▄▄▄█ █▄ █▄▀▄▀██▄█▀████
████▄▄▄▄▄▄▄█▄████▄█▄██▄██████
█████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
```