//var %x = $chr(3) $+ 4,6this is a test | echo -a $m2h(%x)

works fine here. Your problem is probably that you do $m2h([colorcode]4,6this is a test) because that will put [colorcode4 in $1 and 6this in $2 etc. the , will be lost