Git Product home page Git Product logo

Comments (5)

mna avatar mna commented on September 26, 2024

Yes, it is a limitation of Go's html package, it only supports UTF-8 encoded documents. From the docs:

It is the caller's responsibility to ensure that the Reader provides UTF-8 encoded HTML.

I believe CJK requires UTF-16, right? I'll leave this issue open for future reference, as this is an issue that needs to be resolved at a lower level than goquery.

from goquery.

pa001024 avatar pa001024 commented on September 26, 2024

you can use iconv for that

from goquery.

mna avatar mna commented on September 26, 2024

Thanks for the info, following on this I found the library https://code.google.com/p/go-charset/ (which has an iconv interface) by Roger Peppe, so this should be of high quality. Full doc: http://godoc.org/code.google.com/p/go-charset/charset

If someone feels like writing a little example, drop me a line and I'll add it to the doc (or the wiki).

from goquery.

raichu avatar raichu commented on September 26, 2024

There is no "CJK encoding".
UTF-16, some variant of Shift-JIS or EUC-JP, and one of myriad Chinese encodings all all different encodings.
For UTF16, check syscall_windows.go.
Otherwise (such as GBK), you'll need iconv, go-charset doesn't have them.

from goquery.

raichu avatar raichu commented on September 26, 2024

By the way, I found this package: https://code.google.com/p/go.text

from goquery.

Related Issues (20)

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.