|
@@ -98,6 +98,7 @@ type CodeSet struct {
|
98
|
98
|
UnshiftCode byte
|
99
|
99
|
|
100
|
100
|
runeToCodeSet map[rune]code
|
|
101
|
+ initialized bool
|
101
|
102
|
}
|
102
|
103
|
|
103
|
104
|
type code struct {
|
|
@@ -105,8 +106,15 @@ type code struct {
|
105
|
106
|
v byte
|
106
|
107
|
}
|
107
|
108
|
|
108
|
|
-//Initialize is fun
|
109
|
|
-func (cs *CodeSet) Initialize() *CodeSet {
|
|
109
|
+//LoadCharset is fun
|
|
110
|
+func LoadCharset(cs *CodeSet) *CodeSet {
|
|
111
|
+ if !cs.initialized {
|
|
112
|
+ cs.initialize()
|
|
113
|
+ }
|
|
114
|
+ return cs
|
|
115
|
+}
|
|
116
|
+
|
|
117
|
+func (cs *CodeSet) initialize() *CodeSet {
|
110
|
118
|
|
111
|
119
|
cs.runeToCodeSet = make(map[rune]code)
|
112
|
120
|
|