def xml_encode string
      puts string.each_char.size
      string.each_char.map do |p|
        case 
        when CONVERTIBLES[p]
          CONVERTIBLES[p]
        when XML_ENTITIES[p]
          "&##{XML_ENTITIES[p]};"
        else
          p
        end
      end.reduce(:+)
    end
def xml_encode string
      puts string.each_char.size
      string.each_char.map do |p|
        case 
        when CONVERTIBLES[p]
          CONVERTIBLES[p]
        when XML_ENTITIES[p]
          "&##{XML_ENTITIES[p]};"
        else
          p
        end
      end.reduce(:+)
    end
Encode Russian UTF-8 string to XML Entities format,
 converting weird Unicode chars along the way