This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a44a595
Showing
218 changed files
with
2,868 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ebbeafdc430eb6c7e44e9a730a38eaff4c56ba3a 31 | ||
ebbeafdc430eb6c7e44e9a730a38eaff4c56ba3a default |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
31 ebbeafdc430eb6c7e44e9a730a38eaff4c56ba3a 714fcf858fc192a7b9eb67cf973e468573bcc9ee | ||
|
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[paths] | ||
default = https://code.google.com/p/go-charset/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
revlogv1 | ||
fncache | ||
store | ||
dotencode |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
data/charset/iconv/list_query.go.i | ||
data/CONTRIBUTORS.i | ||
data/charset/data/koi8-r.cp.i | ||
data/data/big5.dat.i | ||
data/charset/data/iso-8859-9.cp.i | ||
data/data/iso-8859-8.cp.go.i | ||
data/charset/data/ibm850.cp.i | ||
data/charset/utf16.go.i | ||
data/datafiles/iso-8859-9.cp.i | ||
data/charset/data/ibm437.cp.i | ||
data/charset/data/iso-8859-10.cp.i | ||
data/data/windows-1251.cp.i | ||
data/lib/codereview/codereview.cfg.i | ||
data/data/ibm866.cp.i | ||
data/data/data_windows-1250.cp.go.i | ||
data/charset/data/ibm866.cp.i | ||
data/data/data_iso-8859-10.cp.go.i | ||
data/data/windows-1251.cp.go.i | ||
data/charset/data/big5.dat.i | ||
data/generate-charset-data/generate.go.i | ||
data/datafiles/windows-1252.cp.i | ||
data/datafiles/cp932.dat.i | ||
data/datafiles/iso-8859-10.cp.i | ||
data/charset/data/windows-1250.cp.i | ||
data/charset/data/iso-8859-3.cp.i | ||
data/data/ibm850.cp.i | ||
data/data/koi8-r.cp.i | ||
data/charset/data/iso-8859-6.cp.i | ||
data/charset/charset.go.i | ||
data/data/windows-1250.cp.i | ||
data/.hgtags.i | ||
data/datafiles/iso-8859-6.cp.i | ||
data/charset/local.go.i | ||
data/data/data_charsets.json.go.i | ||
data/data/ibm850.cp.go.i | ||
data/data/iso-8859-9.cp.i | ||
data/data/doc.go.i | ||
data/data/data_koi8-r.cp.go.i | ||
data/data/iso-8859-2.cp.go.i | ||
data/charset/file.go.i | ||
data/charset/data/iso-8859-1.cp.i | ||
data/data/windows-1250.cp.go.i | ||
data/charset/data/windows-1252.cp.i | ||
data/data/data_iso-8859-4.cp.go.i | ||
data/data/data_iso-8859-5.cp.go.i | ||
data/data/data_iso-8859-2.cp.go.i | ||
data/data/big5.dat.go.i | ||
data/datafiles/big5.dat.i | ||
data/data/data_cp932.dat.go.i | ||
data/data/windows-1252.cp.go.i | ||
data/data/iso-8859-3.cp.go.i | ||
data/charset/data/iso-8859-15.cp.i | ||
data/data/iso-8859-7.cp.i | ||
data/data/iso-8859-6.cp.i | ||
data/datafiles/iso-8859-5.cp.i | ||
data/datafiles/windows-1251.cp.i | ||
data/data/iso-8859-5.cp.go.i | ||
data/charset/charset_test.go.i | ||
data/charset/8bit.go.i | ||
data/data/iso-8859-10.cp.go.i | ||
data/charset/data/iso-8859-8.cp.i | ||
data/charset/big5.go.i | ||
data/data/iso-8859-7.cp.go.i | ||
data/data/data_iso-8859-6.cp.go.i | ||
data/data/cp932.dat.go.i | ||
data/data/data_iso-8859-3.cp.go.i | ||
data/data/generate.go.i | ||
data/charset/data/charsets.json.i | ||
data/datafiles/windows-1250.cp.i | ||
data/AUTHORS.i | ||
data/data/iso-8859-15.cp.go.i | ||
data/datafiles/ibm866.cp.i | ||
data/data/koi8-r.cp.go.i | ||
data/data/iso-8859-15.cp.i | ||
data/data/cp932.dat.i | ||
data/cmd/tcs/tcs.go.i | ||
data/data/data_iso-8859-1.cp.go.i | ||
data/data/data_windows-1251.cp.go.i | ||
data/charset/Makefile.i | ||
data/charset/iconv/list_external.go.i | ||
data/datafiles/ibm437.cp.i | ||
data/datafiles/iso-8859-4.cp.i | ||
data/charset/codepage.go.i | ||
data/charset/data/iso-8859-4.cp.i | ||
data/charset/data/iso-8859-5.cp.i | ||
data/data/data_iso-8859-9.cp.go.i | ||
data/cmd/tcs/Makefile.i | ||
data/data/data_iso-8859-15.cp.go.i | ||
data/data/charsets.json.i | ||
data/datafiles/iso-8859-8.cp.i | ||
data/data/data_iso-8859-7.cp.go.i | ||
data/data/data_jisx0201kana.dat.go.i | ||
data/data/jisx0201kana.dat.go.i | ||
data/datafiles/iso-8859-15.cp.i | ||
data/data/iso-8859-8.cp.i | ||
data/datafiles/iso-8859-2.cp.i | ||
data/data/ibm437.cp.i | ||
data/charset/example_test.go.i | ||
data/charset/cp932.go.i | ||
data/data/iso-8859-9.cp.go.i | ||
data/datafiles/iso-8859-7.cp.i | ||
data/data/ibm866.cp.go.i | ||
data/charset/data/iso-8859-7.cp.i | ||
data/charset/utf8.go.i | ||
data/data/windows-1252.cp.i | ||
data/data/data_windows-1252.cp.go.i | ||
data/data/data_ibm437.cp.go.i | ||
data/data/iso-8859-1.cp.go.i | ||
data/datafiles/iso-8859-1.cp.i | ||
data/datafiles/jisx0201kana.dat.i | ||
data/datafiles/ibm850.cp.i | ||
data/data/iso-8859-3.cp.i | ||
data/data/jisx0201kana.dat.i | ||
data/data/iso-8859-1.cp.i | ||
data/datafiles/iso-8859-3.cp.i | ||
data/data/iso-8859-6.cp.go.i | ||
data/data/iso-8859-5.cp.i | ||
data/data/data_ibm866.cp.go.i | ||
data/charset/iconv/iconv.go.i | ||
data/data/ibm437.cp.go.i | ||
data/charset/iconv/iconv_test.go.i | ||
data/datafiles/koi8-r.cp.i | ||
data/data/charsets.json.go.i | ||
data/data/iso-8859-4.cp.go.i | ||
data/data/iso-8859-10.cp.i | ||
data/charset/data/iso-8859-2.cp.i | ||
data/charset/data/windows-1251.cp.i | ||
data/data/iso-8859-2.cp.i | ||
data/data/data_big5.dat.go.i | ||
data/data/data_ibm850.cp.go.i | ||
data/datafiles/charsets.json.i | ||
data/data/iso-8859-4.cp.i | ||
data/data/data_iso-8859-8.cp.go.i | ||
data/charset/iconv/Makefile.i | ||
data/charset/iconv/list_static.go.i |
Empty file.
Binary file not shown.
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
0 | ||
pull | ||
https://code.google.com/p/go-charset/ |
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This is the official list of go-charset authors for copyright purposes. | ||
# This file is distinct from the CONTRIBUTORS files. | ||
# See the latter for an explanation. | ||
|
||
# Names should be added to this file as | ||
# Name or Organization <email address> | ||
# The email address is not required for organizations. | ||
|
||
# Please keep the list sorted. | ||
|
||
Roger Peppe <rogpeppe@gmail.com> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This is the official list of people who can contribute | ||
# (and typically have contributed) code to the go-charset repository. | ||
# The AUTHORS file lists the copyright holders; this file | ||
# lists people. For example, Google employees are listed here | ||
# but not in AUTHORS, because Google holds the copyright. | ||
# | ||
# The submission process automatically checks to make sure | ||
# that people submitting code are listed in this file (by email address). | ||
# XXX more bumph here? | ||
# Names should be added to this file like so: | ||
# Name <email address> | ||
|
||
# Please keep the list sorted. | ||
|
||
Roger Peppe <rogpeppe@gmail.com> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package charset | ||
|
||
import ( | ||
"fmt" | ||
"unicode/utf8" | ||
) | ||
|
||
func init() { | ||
registerClass("big5", fromBig5, nil) | ||
} | ||
|
||
// Big5 consists of 89 fonts of 157 chars each | ||
const ( | ||
big5Max = 13973 | ||
big5Font = 157 | ||
big5Data = "big5.dat" | ||
) | ||
|
||
type translateFromBig5 struct { | ||
font int | ||
scratch []byte | ||
big5map []rune | ||
} | ||
|
||
func (p *translateFromBig5) Translate(data []byte, eof bool) (int, []byte, error) { | ||
p.scratch = p.scratch[:0] | ||
n := 0 | ||
for len(data) > 0 { | ||
c := int(data[0]) | ||
data = data[1:] | ||
n++ | ||
if p.font == -1 { | ||
// idle state | ||
if c >= 0xa1 { | ||
p.font = c | ||
continue | ||
} | ||
if c == 26 { | ||
c = '\n' | ||
} | ||
continue | ||
} | ||
f := p.font | ||
p.font = -1 | ||
r := utf8.RuneError | ||
switch { | ||
case c >= 64 && c <= 126: | ||
c -= 64 | ||
case c >= 161 && c <= 254: | ||
c = c - 161 + 63 | ||
default: | ||
// bad big5 char | ||
f = 255 | ||
} | ||
if f <= 254 { | ||
f -= 161 | ||
ix := f*big5Font + c | ||
if ix < len(p.big5map) { | ||
r = p.big5map[ix] | ||
} | ||
if r == -1 { | ||
r = utf8.RuneError | ||
} | ||
} | ||
p.scratch = appendRune(p.scratch, r) | ||
} | ||
return n, p.scratch, nil | ||
} | ||
|
||
type big5Key bool | ||
|
||
func fromBig5(arg string) (Translator, error) { | ||
big5map, err := cache(big5Key(false), func() (interface{}, error) { | ||
data, err := readFile(big5Data) | ||
if err != nil { | ||
return nil, fmt.Errorf("charset: cannot open big5 data file: %v", err) | ||
} | ||
big5map := []rune(string(data)) | ||
if len(big5map) != big5Max { | ||
return nil, fmt.Errorf("charset: corrupt big5 data") | ||
} | ||
return big5map, nil | ||
}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &translateFromBig5{big5map: big5map.([]rune), font: -1}, nil | ||
} |
Oops, something went wrong.