Jump to content

Convert between String types ASCII / UTF-32


ofer.yishai

Recommended Posts

For English characters and digits, the conversion is easy. Each byte in the ascii is being copied to the lower byte of the matching 4 bytes. (each byte is being padded with 3 "nulls").

You need use a buffer. Clear it first, iterate the ASCII string, and copy the character in index i to the buffer at offset i*4

Then use Buffer to tag in order to copy the result to a UTF32 tag.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.