From 51492ccb993f95471b061d16c6eee9652a6df17e Mon Sep 17 00:00:00 2001 From: RageCage64 Date: Tue, 30 Aug 2022 13:00:43 -0400 Subject: [PATCH] update readme --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4f777a..fa75c33 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ -# go-codepoint-converter -Converts strings of UTF-8 codepoint representation to the UTF-8 encoding +# go-utf8-codepoint-converter + +Converts strings of UTF-8 codepoint representation to the UTF-8 encoding + +## Usage + +This library takes a literal codepoint string and calculates the UTF-8 encoding of it. Example: + +```go +package main + +import "github.com/RageCage64/go-utf8-codepoint-converter/codepoint" + +func main() { + codepointStr := "U+1F60A" + utf8bytes, _ := codepoint.Convert(codepointStr) + fmt.Println(string(utf8bytes)) + codepointStr := "\\U0001F603" + utf8bytes, _ = codepoint.Convert(codepointStr) + fmt.Println(string(utf8bytes)) +} +``` +Result: +``` +😊 +😃 +``` \ No newline at end of file