Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelog/simple_utf8
Simple utf8 to binary and viceversa translation routines for Erlang
https://github.com/marcelog/simple_utf8
Last synced: 15 days ago
JSON representation
Simple utf8 to binary and viceversa translation routines for Erlang
- Host: GitHub
- URL: https://github.com/marcelog/simple_utf8
- Owner: marcelog
- License: apache-2.0
- Created: 2014-02-28T21:20:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-28T21:49:55.000Z (almost 11 years ago)
- Last Synced: 2024-11-16T06:56:40.151Z (2 months ago)
- Language: Erlang
- Homepage:
- Size: 125 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple UTF8 to/from binaries routines
## About
This was done just for fun. Valid sequences include 1, 2, 3, 4, 5, and 6 bytes
long.## Binaries to UTF8 pointcodes
simple_utf8:bin_to_cp(Bin).
## UTF8 pointcodes to binaries
simple_utf8:cp_to_bin(CodePoints).
## Example
1> Utf8Bin = simple_utf8:cp_to_bin("中國哲學書電子化計劃").
<<228,184,173,229,156,139,229,147,178,229,173,184,230,155,
184,233,155,187,229,173,144,229,140,150,232,168,136,229,
138,...>>
2> "中國哲學書電子化計劃" = simple_utf8:bin_to_cp(Utf8Bin).
[20013,22283,21746,23416,26360,38651,23376,21270,35336,
21123]