Skip to content

Commit

Permalink
helper sequences checks for more glyphs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Sep 16, 2024
1 parent ce5a7a4 commit a9c71a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Defacto2/helper

go 1.22.5
go 1.22.7

require (
github.com/google/uuid v1.6.0
Expand Down
7 changes: 6 additions & 1 deletion helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ func Determine(reader io.Reader) encoding.Encoding {
// using a legacy 8-bit code page encoding, such as CP-437.
multibyte := false
for _, r := range bytes.Runes(p) {
fmt.Println(r, utf8.RuneLen(r), string(r))
if utf8.RuneLen(r) > 1 {
if r == unknownRune {
break
Expand All @@ -211,6 +210,9 @@ func sequences(p []byte) encoding.Encoding {
mediumShade = 0xb1
fullBlock = 0xdb
interpunct = 0xfa
shadeLight = 0xb0
shadeMedium = 0xb1
shadeDark = 0xb2
)
chars := []byte{
lowerHalfBlock,
Expand All @@ -220,6 +222,9 @@ func sequences(p []byte) encoding.Encoding {
mediumShade,
fullBlock,
interpunct,
shadeLight,
shadeMedium,
shadeDark,
}
for _, char := range chars {
const count = 4
Expand Down

0 comments on commit a9c71a2

Please sign in to comment.