# File lib/edi4r/edifact.rb, line 291
    def initialize( root, source=nil )
      super( root, root, 'UNA')

      raise "UNA.new requires 'version' in the interchange" unless root.version
      raise "UNA.new requires 'charset' in the interchange" unless root.charset

      if source =~ /^UNA(......)$/  # Take what's given
        @chars = $1

      elsif (source == nil or source.empty?) # Use EDIFACT default rules
        if root.version==2 and root.charset=='UNOB'
          @chars = "\x11\x12.? \x14"
        elsif root.version==4
          @chars = ":+.?*'"
        else
          @chars = ":+.? '"
        end
        
      else
        raise "This is not a valid UNA source string: #{source}"
      end

      @ce_sep, @de_sep, @decimal_sign, 
      @esc_char, @rep_sep, @seg_term = @chars.split('').map{|c| c[0]}
      set_patterns
    end