'Return a POSIX.1-2001 extended or global header sequence
that contains a list of keyword, value pairs. The values
must be unicode objects.'

@classmethod
def _create_pax_generic_header(cls, pax_headers, type=XHDTYPE):

    records = []
    for (keyword, value) in pax_headers.iteritems():
        keyword = keyword.encode('utf8')
        value = value.encode('utf8')
        l = ((len(keyword) + len(value)) + 3)
        n = p = 0
        while True:
            n = (l + len(str(p)))
            if (n == p):
                break
            p = n
        records.append(('%d    %s=%s\n' % (p, keyword, value)))
    records = ''.join(records)
    info = {}
    info['name'] = '././@PaxHeader'
    info['type'] = type
    info['size'] = len(records)
    info['magic'] = POSIX_MAGIC
    return (cls._create_header(info, USTAR_FORMAT) + cls._create_payload(records))
