convert_to_encoded_string (KBTypeConversionsMixin)

    # File lib/kirbybase.rb, line 268
        def convert_to_encoded_string(data_type, value)
            return KB_NIL if value.nil?

            case data_type
            when :YAML
                y = value.to_yaml
                if y =~ ENCODE_RE
                    return y.gsub("&", '&amp;').gsub("\n", '&linefeed;').gsub(
                     "\r", '&carriage_return;').gsub("\032", '&substitute;'
                     ).gsub("|", '&pipe;')
                else
                    return y
                end
            when :String
                if value =~ ENCODE_RE
                    return value.gsub("&", '&amp;').gsub("\n", '&linefeed;'
                     ).gsub("\r", '&carriage_return;').gsub("\032",
                     '&substitute;').gsub("|", '&pipe;')
                else
                    return value
                end
            when :Memo
                return value.filepath
            when :Blob
                return value.filepath
            else
                return value.to_s
            end
        end