Get Chinese garbled title
I use the httpx program under the terminal to get the title as normal Chinese, but when I get the title through code, it is garbled. my httpx version is 1.3.7 and I use the following code to get the title and get garbled characters
package main
import (
"fmt"
"log"
"github.com/projectdiscovery/goflags"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/gologger/levels"
"github.com/projectdiscovery/httpx/runner"
)
func main() {
gologger.DefaultLogger.SetMaxLevel(levels.LevelVerbose)
options := runner.Options{
Methods: "GET",
InputTargetHost: goflags.StringSlice{"http://103.45.249.230:7878/"},
//InputFile: "./targetDomains.txt", // path to file containing the target domains list
OnResult: func(r runner.Result) {
fmt.Println("Title:", r.Title)
fmt.Println("Raw:", r.Raw)
// handle error
if r.Err != nil {
fmt.Printf("[Err] %s: %s\n", r.Input, r.Err)
return
}
fmt.Printf("%s %s %d\n", r.Input, r.Host, r.StatusCode)
},
}
if err := options.ValidateOptions(); err != nil {
log.Fatal(err)
}
httpxRunner, err := runner.New(&options)
if err != nil {
log.Fatal(err)
}
defer httpxRunner.Close()
httpxRunner.RunEnumeration()
}
I think it may be related to the gb2312 encoding
This is simple a lack of fonts on your system. If you want to actually see the unicode, ensure you have fonts that support high level unicode. Some of the fonts i installed are:
font-unifont-bdf freefont-ttf noto-fonts-ttf noto-fonts-ttf-extra noto-fonts-cjk noto-fonts-emoji
Also, MOST terminals are using utf8 by default, but make sure your locales are setup to us en_US UTF-8 or w.e in /etc/locale or whereever its managed on your system.
edit: this can be closed now btw
Closing as the issue seems unrelated to the tool