feat: add UTF-8 support and base256emoji

This include fixes for UTF-8 as well as base256emoji encoding (an encoding which actually use UTF-8).
This commit is contained in:
Jorropo
2022-06-08 07:31:52 +02:00
committed by Rod Vagg
parent 0bd72a8c32
commit df5b7bc6ee
7 changed files with 160 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ package multibase
import (
"testing"
"unicode/utf8"
)
func TestInvalidCode(t *testing.T) {
@@ -43,9 +44,10 @@ func TestEncoder(t *testing.T) {
}
// Test that an encoder can be created from the single letter
// prefix
_, err = EncoderByName(str[0:1])
r, _ := utf8.DecodeRuneInString(str)
_, err = EncoderByName(string(r))
if err != nil {
t.Fatalf("EncoderByName(%s) failed: %v", str[0:1], err)
t.Fatalf("EncoderByName(%s) failed: %v", string(r), err)
}
}
}