1 ) A compiler for optimizing conversion of a character coding system used for characters stored in a string variable in a target program to be optimized, said compiler comprising: a conversion instruction generation section which generates a conversion instruction, to convert the character code for a character from a character code according to a first character coding system to another character code according to a second character coding system and then to store said character with said converted character code in a string variable, prior to each of a plurality of procedures by which said character which was written into said string variable in said first character coding system is read out and is used in said second character coding system; and a conversion instruction removal section which removes each of conversion instructions generated by said conversion instruction generation section, if a character with a character code according to said second character coding system is stored in said string variable in each of the execution paths executed prior to said conversion instruction.