求用UTF-8解开或者GBK解开

img


太好奇是什么了,可以帮帮忙解开吗?电脑没在身边,但太好奇了,走过的可以帮帮忙嘛

代码是这样的

public class Main {
    public static void main(String[] args) throws Exception {
        byte[] a = new byte[]{-60, -29, -45, -48, -60, -48, -59, -13, -45, -47, -62, -16};
        String gbk = new String(a, "GBK");
        System.out.println(gbk);
    }
}

结果是

你有男朋友吗
data = [-60,-29,-45,-48,-60,-48,-59,-13,-45,-47,-62,-16]
unsigned_data = bytes(map(lambda x: x & 0xff, data))

text = unsigned_data.decode('gbk')
print(text)

img


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    char str[] = {-28, -67, -96, -26, -100, -119, -25, -108, -73, -26, -100, -117, -27, -113, -117, -27, -112, -105,'\0'};
    printf("%s\n", str);
    return 0;
}

所以:你有男朋友吗