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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...