Arduino 中文转码GBK Python脚本转码
程序员文章站
2022-03-16 09:03:49
...
char a[4]={0xC4,0xE3,0xBA,0xC3};
String zi="";
void setup() {
Serial.begin(9600);
for(int i=0;i<4;i++) zi+=a[i];
}
void loop() {
Serial.println(zi);
delay(1000);
}
s="你好"
s2=s.encode('GBK').hex() # c4e3bac3
for i in range(len(s2)):
if i+1<len(s2) and i%2==0:
print("0X"+(s2[i]+s2[i+1]).upper(),end=",") # 0XC4,0XE3,0XBA,0XC3,
转码网站:http://www.mytju.com/classcode/tools/urlencode_gb2312.asp
下一篇: 靠边站,单项分支结构来了(附源码)