mirror of
https://github.com/osmarks/random-stuff
synced 2024-12-28 02:50:33 +00:00
15 lines
697 B
Go
15 lines
697 B
Go
|
package main
|
||
|
|
||
|
var cp437 = []rune("\x00☺☻♥♦♣♠•◘○◙♂♀♪♬☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\u00A0")
|
||
|
|
||
|
func mapCP437(s string) string {
|
||
|
b := []byte(s)
|
||
|
r := make([]rune, len(b))
|
||
|
|
||
|
for i, c := range b {
|
||
|
r[i] = cp437[c]
|
||
|
}
|
||
|
|
||
|
return string(r)
|
||
|
}
|