Documentation ¶
Overview ¶
Package conv
- Version: 1.0.0
- Copyright (c) 2021. Pashifika *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Package conv
- Version: 1.0.0
- Copyright (c) 2021. Pashifika *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Index ¶
- func BytesToString(b []byte) string
- func CutUnicodeString(str string, length int) string
- func FindUnicodeString(src, find string) bool
- func StringToBytes(s string) []byte
- func StringToBytesV2(s string, buffer int) []byte
- type Decoder
- func (d *Decoder) ByteToByte(src []byte) ([]byte, error)
- func (d *Decoder) ByteToString(src []byte) (string, error)
- func (d *Decoder) GetEncoding() encoding.Encoding
- func (d *Decoder) GetReader(r io.Reader) *transform.Reader
- func (d *Decoder) StringToByte(src string) ([]byte, error)
- func (d *Decoder) StringToString(src string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CutUnicodeString ¶
CutUnicodeString is like RuneCount but its input is a string.
func FindUnicodeString ¶
FindUnicodeString is use rune to find the string.
func StringToBytesV2 ¶
StringToBytesV2 convert string to bytes (buffered I/O)
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
NewDecoder new encoder will use HTML escape sequences for runes that are not supported by the character set.
func (*Decoder) ByteToByte ¶
ByteToByte returns a new byte slice with the result of converting b[:n] using t, where n <= len(b). If err == nil, n will be len(b). It calls Reset on t.
func (*Decoder) ByteToString ¶
ByteToString returns a new string with the result of converting b[:n] using t, where n <= len(b). If err == nil, n will be len(b). It calls Reset on t.
func (*Decoder) GetEncoding ¶
GetEncoding get HTML character set encoder
func (*Decoder) GetReader ¶
GetReader returns a new Reader that wraps r by transforming the bytes read via t. It calls Reset on t.
func (*Decoder) StringToByte ¶
StringToByte returns a byte slice with the result of converting s[:n] using t, where n <= len(s). If err == nil, n will be len(s). It calls Reset on t.