diff options
author | Wim <wim@42.be> | 2022-03-19 23:14:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 23:14:56 +0100 |
commit | f0f801402d95b1f49018fa9af77c341ff4c4de5f (patch) | |
tree | d7ba0f532c2a9accf702d3347d2efba725e4419f /vendor/github.com/missdeer/golib/ic/ic.go | |
parent | 663850a2b825e762667f930cd5a4ee87de853444 (diff) | |
download | matterbridge-msglm-f0f801402d95b1f49018fa9af77c341ff4c4de5f.tar.gz matterbridge-msglm-f0f801402d95b1f49018fa9af77c341ff4c4de5f.tar.bz2 matterbridge-msglm-f0f801402d95b1f49018fa9af77c341ff4c4de5f.zip |
Refactor utf-8 conversion (irc) (#1767)
Diffstat (limited to 'vendor/github.com/missdeer/golib/ic/ic.go')
-rw-r--r-- | vendor/github.com/missdeer/golib/ic/ic.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/vendor/github.com/missdeer/golib/ic/ic.go b/vendor/github.com/missdeer/golib/ic/ic.go deleted file mode 100644 index 9e414e36..00000000 --- a/vendor/github.com/missdeer/golib/ic/ic.go +++ /dev/null @@ -1,31 +0,0 @@ -package ic - -import "log" - -// Convert convert bytes from CJK or UTF-8 to UTF-8 or CJK -func Convert(from string, to string, src []byte) []byte { - if to == "utf-8" { - out, e := ToUTF8(from, src) - if e == nil { - return out - } - log.Printf("converting from %s to UTF-8 failed: %v", from, e) - return src - } - - if from == "utf-8" { - out, e := FromUTF8(to, src) - if e == nil { - return out - } - log.Printf("converting from UTF-8 to %s failed: %v", to, e) - return src - } - log.Println("only converting between CJK encodings and UTF-8 is supported") - return src -} - -// ConvertString convert string from CJK or UTF-8 to UTF-8 or CJK -func ConvertString(from string, to string, src string) string { - return string(Convert(from, to, []byte(src))) -} |