{"id":19068556,"url":"https://github.com/lydanne/utf8mb3","last_synced_at":"2026-02-13T21:22:15.913Z","repository":{"id":142556035,"uuid":"613664753","full_name":"Lydanne/utf8mb3","owner":"Lydanne","description":"Let mysql's utf8 encoding store four-byte characters such as emoji(让 mysql 的 utf8 编码存储表情符号这类的四字节字符).","archived":false,"fork":false,"pushed_at":"2023-04-03T07:38:14.000Z","size":172,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T10:30:15.411Z","etag":null,"topics":["emoji","javascript","mysql","nodejs","rust","utf8","utf8mb4","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lydanne.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-14T02:45:23.000Z","updated_at":"2023-09-07T05:36:54.000Z","dependencies_parsed_at":"2024-08-10T10:45:14.441Z","dependency_job_id":null,"html_url":"https://github.com/Lydanne/utf8mb3","commit_stats":null,"previous_names":["wumacoder/utf8mb3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lydanne/utf8mb3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lydanne%2Futf8mb3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lydanne%2Futf8mb3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lydanne%2Futf8mb3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lydanne%2Futf8mb3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lydanne","download_url":"https://codeload.github.com/Lydanne/utf8mb3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lydanne%2Futf8mb3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29417981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["emoji","javascript","mysql","nodejs","rust","utf8","utf8mb4","wasm","webassembly"],"created_at":"2024-11-09T01:09:57.597Z","updated_at":"2026-02-13T21:22:15.882Z","avatar_url":"https://github.com/Lydanne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\n# utf8mb3\n\n![license](https://img.shields.io/npm/l/utf8mb3) ![npm](https://img.shields.io/npm/v/utf8mb3)\n\n![encode](./encode.png)\n\n\u003c/div\u003e\n\nLet mysql's utf8 encoding store four-byte characters such as emoji(让 mysql 的 utf8 编码存储表情符号这类的四字节字符).\n\n## Feature\n\n- Four-byte characters to three-byte characters(四字节字符转三字节字符)\n- Repeated coding remains unchanged(重复编码内容不变)\n- support wasm module(支持 wasm 使用)\n\n## JS Use\n\n\u003e [Detailed description](./packages/utf8mb3-wasm/wasm-libs/utf8mb3-js/readme.md)\n\u003e 支持 nodejs 和 browser 环境\n\n```js\nconst {\n  encode,\n  decode,\n  include_encode_utf8mb3,\n  include_utf8mb4,\n} = require(\"utf8mb3\");\n\nconst str = \"汉😊😊🛝🛝🛝汉\";\n// const str = \"😊🛝🛝\";\n\nconsole.log(str, str.length);\n\nconst utf8mb3 = encode(str);\n\nconsole.log(\"encodeUtf8mb4\", utf8mb3, utf8mb3.length); // encodeUtf8mb4 汉ꂶꂶ鷶鷶鷶汉 12\nconsole.log(\"decodeUtf8mb4\", decode(utf8mb3)); // decodeUtf8mb4 汉😊😊🛝🛝🛝汉\nconsole.log(\"include_encode_utf8mb3\", include_encode_utf8mb3(utf8mb3)); // include_encode_utf8mb3 true\nconsole.log(\"include_utf8mb4\", include_utf8mb4(str)); // include_utf8mb4 true\nconsole.log(\"include_utf8mb4\", include_utf8mb4(\"测试\")); // include_utf8mb4 false\n```\n\n## Rust Use\n\n\u003e [Detailed description](./packages/utf8mb3/readme.md)\n\n```rust\nlet str = \"😊\";\nlet result = utf8mb3::encode(str);\nprintln!(\"encode: {}\", result); // encode: \nprintln!(\"decode: {}\", utf8mb3::decode(\u0026result)); // decode: 😊\n\n```\n\n## WASI Use\n\n...\n\n## Performance\n\nMacOS: 13 , MacBook Pro m1 2021\n\n| Source                | 10000000 😊 coding time | Test Script                                            |\n| --------------------- | ----------------------- | ------------------------------------------------------ |\n| nodejs native         | 684.573ms               | commemorate/utf8mb3-js/test.js                         |\n| rust native           | 61.85475ms              | packages/utf8mb3/src/lib.rs                            |\n| wasm run nodejs       | 96.927ms                | packages/utf8mb3-wasm/examples/utf8mb3-js-nodejs-play  |\n| wasm run edge browser | 100.6ms                 | packages/utf8mb3-wasm/examples/utf8mb3-js-browser-play |\n| wasi run wasmedge AOT | 35ms                    |                                                        |\n| wasi run warmer       | 60ms                    |                                                        |\n| wasi run wasmtime     | 70ms                    |                                                        |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flydanne%2Futf8mb3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flydanne%2Futf8mb3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flydanne%2Futf8mb3/lists"}