mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-02-04 09:15:08 +01:00
initial ngword commit
This commit is contained in:
@@ -29,6 +29,19 @@ func SJISToUTF8(b []byte) string {
|
|||||||
return string(result)
|
return string(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ToNGWord(x string) []uint16 {
|
||||||
|
var w []uint16
|
||||||
|
for _, r := range []rune(x) {
|
||||||
|
if r > 0xFF {
|
||||||
|
t := UTF8ToSJIS(string(r))
|
||||||
|
w = append(w, uint16(t[1])<<8|uint16(t[0]))
|
||||||
|
} else {
|
||||||
|
w = append(w, uint16(r))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
func PaddedString(x string, size uint, t bool) []byte {
|
func PaddedString(x string, size uint, t bool) []byte {
|
||||||
if t {
|
if t {
|
||||||
e := japanese.ShiftJIS.NewEncoder()
|
e := japanese.ShiftJIS.NewEncoder()
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user