aboutsummaryrefslogtreecommitdiff
path: root/content/strings/utf8.go
diff options
context:
space:
mode:
Diffstat (limited to 'content/strings/utf8.go')
-rw-r--r--content/strings/utf8.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/content/strings/utf8.go b/content/strings/utf8.go
new file mode 100644
index 0000000..d9fa091
--- /dev/null
+++ b/content/strings/utf8.go
@@ -0,0 +1,25 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "fmt"
+
+func main() {
+ const placeOfInterest = `⌘`
+
+ fmt.Printf("plain string: ")
+ fmt.Printf("%s", placeOfInterest)
+ fmt.Printf("\n")
+
+ fmt.Printf("quoted string: ")
+ fmt.Printf("%+q", placeOfInterest)
+ fmt.Printf("\n")
+
+ fmt.Printf("hex bytes: ")
+ for i := 0; i < len(placeOfInterest); i++ {
+ fmt.Printf("%x ", placeOfInterest[i])
+ }
+ fmt.Printf("\n")
+}