Suppose I have these variables,
const uint8_t ndef_default_msg[33] = {
0xd1, 0x02, 0x1c, 0x53, 0x70, 0x91, 0x01, 0x09,
0x54, 0x02, 0x65, 0x6e, 0x4c, 0x69
Maybe not very elegant but simple: define a look up table that maps a character code (0 to 255) into a desired value.
// something like this:
for( i = 0; i < INPUT_LEN; ++i ) {
value_in = input[i];
value_out = lut[value_in];
array_out[i] = value_out;
}
I used such not-elegant solutions a couple of times (e.g. for color mapping) and it worked equally good as other fancy solutions