Created
April 13, 2014 14:09
-
-
Save shanehou/10585712 to your computer and use it in GitHub Desktop.
UTF16 LE BOM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "bufio" | |
import "os" | |
func main() { | |
src, err := os.Open("RegistryBOM") | |
if err != nil { | |
panic(err) | |
} | |
reader := bufio.NewReader(src) | |
BOM, err := reader.Peek(2) | |
if err != nil { | |
panic(err) | |
} | |
_, err = reader.Read(BOM) | |
if err != nil { | |
panic(err) | |
} | |
scanner := bufio.NewScanner(reader) | |
for scanner.Scan() { | |
fmt.Println(scanner.Text()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment