Splunk Dev

Got "unknown encoding" error with Splunk python3

sxu_splunk
Splunk Employee
Splunk Employee

I was tring to write a customized script to read data from API and decode in splunk , but got below error 

when decoding content with "gb2312",   

I tried with a very simple  script like below and could reproduce the issue in splunk in Mac Os

./splunk cmd python3 -c  "print(b'\xce\xd2'.decode('gb2312'))"

sxu_splunk_0-1623217341593.png

BTW:  same script works in splunk in win10

Labels (1)
Tags (2)
0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...