{"id":19320266,"url":"https://github.com/jlyonsmith/rust_qr_code_example","last_synced_at":"2026-06-12T06:32:14.839Z","repository":{"id":225219068,"uuid":"765387162","full_name":"jlyonsmith/rust_qr_code_example","owner":"jlyonsmith","description":"Rust QR code encode/decode example","archived":false,"fork":false,"pushed_at":"2024-02-29T21:23:46.000Z","size":4823,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T01:12:43.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlyonsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-29T20:25:23.000Z","updated_at":"2024-02-29T20:25:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"2442268d-2bf2-4532-91d4-ce473994e03c","html_url":"https://github.com/jlyonsmith/rust_qr_code_example","commit_stats":null,"previous_names":["jlyonsmith/rust_qr_code_example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jlyonsmith/rust_qr_code_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Frust_qr_code_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Frust_qr_code_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Frust_qr_code_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Frust_qr_code_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlyonsmith","download_url":"https://codeload.github.com/jlyonsmith/rust_qr_code_example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Frust_qr_code_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34232790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T01:28:03.823Z","updated_at":"2026-06-12T06:32:14.823Z","avatar_url":"https://github.com/jlyonsmith.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QR Code Rust Example\n\nThis is an example of how to decode and encode QR codes using the currently available Rust crates. It's a good idea to read [How QR codes work](https://www.thonky.com/qr-code-tutorial/) for some background.  Also, this YouTube video on [How QR Codes Are Built](https://www.youtube.com/watch?v=142TGhaTMtI) is the best I have found.\n\nThe app uses the [image](https://docs.rs/image/latest/image/) to read and write image files.\n\nFor decoding I tried a bunch of crates that showed up on Google and the [`quircs`](https://docs.rs/quircs/latest/quircs/) crate seems to work best.  All the decoders I tried are really slow if the image is too big, and often failed to detect the QR code, so down sampling the image to around ~500 wide is a good idea.  In Rust you can down sample with [`ispc-downsampler`](https://lib.rs/crates/ispc-downsampler). For this example, I just used [Acorn on macOS](https://flyingmeat.com/acorn/) for a one time down sample, which is in the examples directory.\n\nRust has [many QR code encoding crates](https://crates.io/search?q=qrcode).  After some research, I found a lot of them encode using the UTF-8 character encoding, and not ISO 8859-1 (Windows 1252).  Although most libraries correctly decect UTF-8, the QR Code specification indicates that ISO 8859-1 is the intended character encoding. Take a look at the codes generated by [qrcodegen](https://crates.io/crates/qrcodegen) which does it correctly.  I discovered this by capturing QR codes from around town and trying to round trip decode then re-encode them. The [`encoding_rs`](https://docs.rs/encoding_rs/0.8.33/encoding_rs/index.html#iso-8859-1) crate explains more about different character encoding schemes.  Most likely, the difference is because to encode UTF-8 in a QR code you need to use a [Extended Channel Interpretation (ECI)](https://www.bardecode.com/en1/qr-codes-and-utf-8-encoding/) to wrap the data.\n\nThe `qrcodegen` project has a good [web interface](https://www.nayuki.io/page/qr-code-generator-library) for testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlyonsmith%2Frust_qr_code_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlyonsmith%2Frust_qr_code_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlyonsmith%2Frust_qr_code_example/lists"}