문제

I am parsing values from a binary file. One value I am parsing is a 16-bit number which represents the UCS-2 encoding of a unicode character. I'm converting it to a character like this:

char c = (char)myInteger;

Is this safe?

도움이 되었습니까?

해결책

Yes, as long as there are no byte-ordering issues this should be fine.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top