wordsearch/fix-wordlist/main.go

26 lines
356 B
Go
Raw Normal View History

2023-10-08 14:25:57 +01:00
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"golang.org/x/text/encoding/charmap"
)
func main() {
dec := charmap.ISO8859_1.NewDecoder()
sc := bufio.NewScanner(dec.Reader(os.Stdin))
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if len(s) > 0 {
fmt.Println(s)
}
}
if err := sc.Err(); err != nil {
log.Fatal(err)
}
}