dump

package
v0.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Octet

func Octet(w io.Writer, r io.Reader) error

Octet output io.Writer hex-dump of byte stream.

Example
package main

import (
	"fmt"
	"os"
	"strings"

	"github.com/goark/gnkf/dump"
)

func main() {
	if err := dump.Octet(os.Stdout, strings.NewReader("こんにちは,世界!\n私の名前は Spiegel です。")); err != nil {
		fmt.Fprintln(os.Stderr, err)
		return
	}
}
Output:

0xe3, 0x81, 0x93, 0xe3, 0x82, 0x93, 0xe3, 0x81, 0xab, 0xe3, 0x81, 0xa1, 0xe3, 0x81, 0xaf, 0xef, 0xbc, 0x8c, 0xe4, 0xb8, 0x96, 0xe7, 0x95, 0x8c, 0xef, 0xbc, 0x81, 0x0a, 0xe7, 0xa7, 0x81, 0xe3, 0x81, 0xae, 0xe5, 0x90, 0x8d, 0xe5, 0x89, 0x8d, 0xe3, 0x81, 0xaf, 0x20, 0x53, 0x70, 0x69, 0x65, 0x67, 0x65, 0x6c, 0x20, 0xe3, 0x81, 0xa7, 0xe3, 0x81, 0x99, 0xe3, 0x80, 0x82

func OctetString

func OctetString(r io.Reader) string

OctetString output hex-dump string.

func UnicodePoint

func UnicodePoint(w io.Writer, r io.Reader) error

UnicodePoint output io.Writer hex-dump of Unicode code point (input text is UTF-8 only).

Example
package main

import (
	"fmt"
	"os"
	"strings"

	"github.com/goark/gnkf/dump"
)

func main() {
	if err := dump.UnicodePoint(os.Stdout, strings.NewReader("こんにちは,世界!\n私の名前は Spiegel です。")); err != nil {
		fmt.Fprintln(os.Stderr, err)
		return
	}
}
Output:

0x3053, 0x3093, 0x306b, 0x3061, 0x306f, 0xff0c, 0x4e16, 0x754c, 0xff01, 0x000a, 0x79c1, 0x306e, 0x540d, 0x524d, 0x306f, 0x0020, 0x0053, 0x0070, 0x0069, 0x0065, 0x0067, 0x0065, 0x006c, 0x0020, 0x3067, 0x3059, 0x3002

func UnicodePointString

func UnicodePointString(r io.Reader) string

UnicodePointString output hex-dump string of Unicode code point (input text is UTF-8 only).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL