Jump to content

Recommended Posts

Posted

Hi all,

 

Anyway to convert between string types? 

 

I would like to store an ASCII string to Data Sampler/User Comment 1  string that is build as UTF-32

 

while compiling the app get an error: Data type mismatch.

 

 

Thanks in advanced,

 

Ofer 

Posted

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.

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.