Go UTF-16

This is just a small code fragment that prints out the Unicode characters from the Fullwidth Latin Letters (range 0xFF01-0xFFEF). This works on little & big endian machines (tested with qemu-arm & qemu-mips compiled using gccgo 4.7.) I thought it might have issues with the way it decodes the int32 into a byte array and re-encodes it to a uint16 array.
package main

import (

func main() {
for i := int32(0xFF00); i <= 0xFFEF; i++ { c := new(bytes.Buffer) if err := binary.Write(c, binary.BigEndian, i); err != nil { fmt.Println("binary.Write failed:", err) return } ui16 := make([]uint16, 2) binary.Read(c, binary.BigEndian, ui16) r := utf16.Decode(ui16) fmt.Printf("0x%4x: %c\n", i, r[1]) } }