blob: 1c128cc9d4365f74c5b0ac5f26a6e144bc29a231 [file]
// Copyright 2013 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package goproperties
import (
"fmt"
)
func ExampleDecode() {
buf := []byte("key = ISO-8859-1 value with unicode literal \\u2318 and umlaut ")
buf = append(buf, 0xE4) // 0xE4 == ä
p, _ := Decode(buf)
v, ok := p["key"]
fmt.Println(ok)
fmt.Println(v)
// Output:
// true
// ISO-8859-1 value with unicode literal ⌘ and umlaut ä
}
func ExampleDecodeFromString() {
p, _ := DecodeFromString("key = UTF-8 value with unicode character ⌘ and umlaut ä")
v, ok := p["key"]
fmt.Println(ok)
fmt.Println(v)
// Output:
// true
// UTF-8 value with unicode character ⌘ and umlaut ä
}