github.com/spotify/syslog-redirector-golang@v0.0.0-20140320174030-4859f03d829a/blog/content/strings/utf8.go (about) 1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import "fmt" 8 9 func main() { 10 const placeOfInterest = `⌘` 11 12 fmt.Printf("plain string: ") 13 fmt.Printf("%s", placeOfInterest) 14 fmt.Printf("\n") 15 16 fmt.Printf("quoted string: ") 17 fmt.Printf("%+q", placeOfInterest) 18 fmt.Printf("\n") 19 20 fmt.Printf("hex bytes: ") 21 for i := 0; i < len(placeOfInterest); i++ { 22 fmt.Printf("%x ", placeOfInterest[i]) 23 } 24 fmt.Printf("\n") 25 }