podman
1// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2
3// Copyright 2016 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7//go:build !go1.16
8
9package idna
10
11// appendMapping appends the mapping for the respective rune. isMapped must be
12// true. A mapping is a categorization of a rune as defined in UTS #46.
13func (c info) appendMapping(b []byte, s string) []byte {
14index := int(c >> indexShift)
15if c&xorBit == 0 {
16s := mappings[index:]
17return append(b, s[1:s[0]+1]...)
18}
19b = append(b, s...)
20if c&inlineXOR == inlineXOR {
21// TODO: support and handle two-byte inline masks
22b[len(b)-1] ^= byte(index)
23} else {
24for p := len(b) - int(xorData[index]); p < len(b); p++ {
25index++
26b[p] ^= xorData[index]
27}
28}
29return b
30}
31