How to fetch properly csv from an API

Hello I am starting to learn Go.
I have been exploring this language and started to fetch some APIs and faced an issue fetching an URL that returns csv file.
On my log appears two weird symbols, can someone help me with that?
Maybe I am not fetching right when type is CSV.

package main

import (
	"io/ioutil"
	"log"
	"net/http"
)
func main(){
	resp, err := http.Get("http://api.tradingeconomics.com/fred/historical/BAMLC0A1CAAAEY?c=guest:guest&d1=2017-05-01&d2=2019-01-01&f=csv")

	if err != nil {
		log.Fatalln(err)
	}

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalln(err)
	}
	log.Println(string("RESULT:"))
	log.Println(string(body))
}

Result:
Captura de ecrã 2023-01-12 153641

Probably a BOM.

1 Like

Thank you NobbZ, didn’t knew BOM.
After some research found this topic that helped removing the symbols
https://gist.github.com/jaypozo/eaf13f7ecfec68b408cf

If someone have a better solution, please advice