Reputation: 143
I'm writing an application where I receive a char from network, for example char "ص" and I have the same char saved in DB from a PHP page, I can see that the char in DB is saved like this 0xd8b5 but the one I receive from network is like 0x0635. How can I change either of them to the other for comparison purposes?
I'm trying to understand the difference between ucs2 and utf16, what is the relationship between these two?
Upvotes: 0
Views: 123
Reputation: 153338
When you see the char "ص" in DB as 0xd8b5, it is in UTF8 encoding. When you see 0x0635, it is in UTF16 encoding. I believe the UCS2 encoding would also be 0x0635. Thus you have a UTF8 versus UTF16 situation, not a UCS2 versus UTF16.
Upvotes: 1