Skip to main content
deleted 28 characters in body
Source Link
Alexey Bril
  • 563
  • 1
  • 8
  • 24

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(strings.TrimPrefix(str, "0x"), 160, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

��

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(strings.TrimPrefix(str, "0x"), 16, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

��

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(str, 0, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

��

deleted 85 characters in body
Source Link
Alexey Bril
  • 563
  • 1
  • 8
  • 24

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(strings.TrimPrefix(str, "0x"), 16, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

enter image description here ��

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(strings.TrimPrefix(str, "0x"), 16, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

enter image description here

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(strings.TrimPrefix(str, "0x"), 16, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

��

Source Link
Alexey Bril
  • 563
  • 1
  • 8
  • 24

This is work fo me.

func main() {
    bytes := []byte{0xfc}
    str := "0xe8"
    pc, _ := strconv.ParseUint(strings.TrimPrefix(str, "0x"), 16, 64)

    bytes = append(bytes, uint8(pc))
    fmt.Printf("%s", bytes)
}

Output:

enter image description here