锟斤拷
现在的 OS 都太强大,已经不太容易找到空置的 unicode , 所以想搞出来只能靠模拟了。
#将 unicode 的占位符重复两遍然后 utf enode ,再用 gbk decode。
s = (u'\uFFFD'.encode('utf8')*2)
print(s.decode('gbk'))
// 锟斤拷
烫 屯
windows 平台下,ms 的 vc++ 编译器中, 当你在栈内开辟新内存时, vc 会使用 0xcc 来初始化填充, 很多个 0xcc 连起来就成了 烫烫烫烫烫 同理在堆内开辟新内存时, 会用 0xcd 填充,这便是 屯屯屯屯屯屯
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
class CStudent {
public:
char name[5];
};
int main()
{
CStudent cs;
CStudent* cs1 = new CStudent;
cout << cs.name << endl; //烫烫烫烫烫
cout << cs1->name << endl; //屯屯屯屯屯屯
return 0;
}