Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Wstring to plastic
Wstring to plastic
Static electricity wstring? unicode2string(char? *? str){

wstring? rst

Bull? Run away? =? Fake;

int? Ryan. =? strlen(str);

int? in tex;

Charles? tmp[5];

memset(tmp,? 0,? 5);

For what? (int? Me? =? 0; ? Me? & lt? len? i++)

{

Charles? c? =? str[I];

Switch? (3)

{

Case? '//':

Case? '%':

Run away? =? True;

Break;

Case? u ':

Case? u ':

What if? (escape)

{

memcpy(tmp,? str+i+ 1,? 4);

sscanf(tmp,? " %x ",& ampintHex); ? //Convert 16 hexadecimal characters into numbers.

rst . push _ back(in tex);

I+= 4;

escape = false

} Otherwise {

rst . push _ back(c);

}

Break;

Default value:

rst . push _ back(c);

Break;

}

}

Return? rst

}