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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user