Skip to content

Commit

Permalink
luajit: use UTF8 strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dlatchx committed Jun 20, 2023
1 parent 32300a3 commit 08ae661
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions format/luajit/luajit.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
"bytes"
"encoding/binary"

"golang.org/x/text/encoding"

"github.com/wader/fq/format"
"github.com/wader/fq/pkg/decode"
"github.com/wader/fq/pkg/interp"
Expand Down Expand Up @@ -81,7 +79,7 @@ func LuaJITDecodeHeader(di *DumpInfo, d *decode.D) {

if !di.Strip {
namelen := d.FieldU8("namelen")
d.FieldStr("name", int(namelen), encoding.Nop)
d.FieldUTF8("name", int(namelen))
}
}

Expand Down Expand Up @@ -134,7 +132,7 @@ func LuaJITDecodeKTabK(d *decode.D) {

if ktabtype >= 5 {
sz := ktabtype - 5
d.FieldStr("str", int(sz), encoding.Nop)
d.FieldUTF8("str", int(sz))
} else {
switch ktabtype {
case 3:
Expand Down Expand Up @@ -185,7 +183,7 @@ func LuaJITDecodeKGC(d *decode.D) {

if kgctype >= 5 {
sz := kgctype - 5
d.FieldStr("str", int(sz), encoding.Nop)
d.FieldUTF8("str", int(sz))
} else {
switch kgctype {
case 0:
Expand Down

0 comments on commit 08ae661

Please sign in to comment.