Skip to content

Commit

Permalink
check Tyler's UTF8 example
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlehane committed Jul 20, 2023
1 parent c039aa5 commit bc1047c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions characterize_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package characterize

import (
"fmt"
"io/ioutil"
"testing"
"unicode/utf8"
Expand All @@ -21,6 +22,17 @@ var suite = []item{
{"examples/twilight.txt", EXTENDED}, // from twilight.zip
}

var thorsted = []byte{0x43, 0x48, 0x5F, 0x32, 0x2E, 0x70, 0x64, 0x66, 0x0A, 0xD0, 0xA1, 0x48, 0x5F, 0x33, 0x2E, 0x70, 0x64, 0x66, 0x0A}

func ExampleUTF8() {
fmt.Print(string(thorsted))
fmt.Print(Detect(thorsted))
// Output:
// CH_2.pdf
// СH_3.pdf
// UTF-8 Unicode
}

func TestDetect(t *testing.T) {
for _, v := range suite {
buf, err := ioutil.ReadFile(v.name)
Expand Down

0 comments on commit bc1047c

Please sign in to comment.