Git Product home page Git Product logo

mahonia's People

Contributors

andybalholm avatar

Watchers

James Cloos avatar

mahonia's Issues

Support for ISO-2022-JP

I am checking for specs for ISO-2022-JP, But haven't figure out how to do it 
yet.

The RFC:

http://tools.ietf.org/html/rfc1468

And the Java implementation:

http://j6a.ru/_i_s_o2022___j_p_8java_source.html


Original issue reported on code.google.com by [email protected] on 15 Feb 2013 at 6:34

Aliases for cpXXX on windows

Please add cpXXX (like: cp932 for sjis) on windows.
Most of unix people use it with utf-8. But on windows, we should convert cpXXX 
strings to utf-8 for go. I can get the cpXXX with fmt.Sprintf("cp%d", GetACP()) 
that using syscall.LoadDLL().

Thanks.

Original issue reported on code.google.com by mattn.jp on 15 May 2013 at 1:11

Decode GB2312 Got a panic

I try to decode a GB2312, got a panic error.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x697f2]

goroutine 1 [running]:
runtime.panic(0x20b320, 0x570cd9)
    /Users/Hong/go/src/pkg/runtime/panic.c:266 +0xb6
code.google.com/p/mahonia.Decoder.ConvertString(0x0, 0xc210045460, 0xda, 
0xc210045460, 0xda)
    /Users/Hong/gocode/src/code.google.com/p/mahonia/convert_string.go:41 +0xd2
main.fetch(0xc21000af80, 0xc21000aef0, 0xc210045460, 0xda)


------------------------
GB2312 (1980) has been superseded by GBK and GB18030 ([2]). So I register the 
GB2312 charset in gbk.go file.
Now It's work fine for me.

 ~GOPATH/src/code.google.com/p/mahonia hg diff 
diff -r 420ce60cb671 gbk.go
--- a/gbk.go    Fri Jul 19 13:15:30 2013 -0700
+++ b/gbk.go    Mon Dec 09 22:27:42 2013 +0800
@@ -12,6 +12,15 @@
            return encodeGBKRune
        },
    })
+   RegisterCharset(&Charset{
+       Name: "GB2312",
+       NewDecoder: func() Decoder {
+           return decodeGBKRune
+       },
+       NewEncoder: func() Encoder {
+           return encodeGBKRune
+       },
+   })
 }

 func decodeGBKRune(p []byte) (r rune, size int, status Status) {



----------
[1]: http://en.wikipedia.org/wiki/GBK
[2]: http://en.wikipedia.org/wiki/GB2312

Original issue reported on code.google.com by [email protected] on 9 Dec 2013 at 2:33

Could you write some test case and examples

You can check the 'Examples' sections
http://golang.org/pkg/testing/#pkg-overview

I think it is better just write TestManonia.go.

So, users could just refer it in

http://godoc.org/code.google.com/p/mahonia

Original issue reported on code.google.com by [email protected] on 4 Jul 2013 at 3:46

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.