You are(were) going in a very wrong direction.
You do not need the unit to contain a specific character in its name.
If cards are different unit types, than that is all that is needed.
Make two arrays: one containing unit types and one containing corresponding characters(better be integer value though).
So to save unit A:
Unit type array is UT and Character array is CA
Unit type of unit A is 'hfoo'; check UT to find the type, ie 'hfoo' is stored on index 7, then check what the value is in CA[7], ie 54.
So the save value of the unit is 54(or you can go with 7 as the index, which would ease the process a bit).
Loading goes the other way around, first checking CA for the value and then creating the corresponding unit from UT.
Note: Method for checking the "UT" array is up to you(Hash tables; Unit types are integers( 'U001' - 'U000'=1))
From there there are a lot of possibilities: just make the combo from the characters the save code or use
an encryption like system(like code maker and etc(all the save systems)) to bind the code to the user name and/or
decrease the length of the code.
P.s. The two(or single) arrays should be created and assigned with values by code which is run at map initialization.