Code Monkey home page Code Monkey logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 26, 2024
I don't understand what your problem is. Please provide some instructions so I 
can try to reproduce your problem here. Marking this issue as Invalid until you 
do.

> Is your module able to decode the data on the fly like 
github.com/go-sql-driver/mysql does?

I don't understand your question. You should be able to use standard utf8 Go 
strings and these will be saved into correspondent MS SQL columns properly. If 
you use non-ascii characters, database columns must be of appropriate type 
(nchar not char and so on).

Alex

Original comment by [email protected] on 14 Nov 2013 at 4:06

  • Changed state: Invalid

from odbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 26, 2024
The MSSQL database I'm using already has data in latin1. I can't change that.

The column type is varchar(MAX) for the query I'm trying to use. I can't change 
that either.

In python I would only need to connect with the following line and I wouldn't 
need to decode from latin1 (_mssql would do it for me):
conn = _mssql.connect(server='ip', user='user', password='password', 
database=bd, charset='ISO-8859-1')

In go, for mysql with go-mysql I guess it would be (I didn't test it):
"user:pass@tcp(ip:port)/database?charset=latin1"

I hope my example is clear enough. Basically, the data is encoded in latin1 in 
a varchar(max) column and I wish I could tell code.google.com/p/odbc that I 
want the data in UTF-8 when I do Scan().

I don't know if it matters but the database collation is 'French_CI_AS'.

Original comment by [email protected] on 14 Nov 2013 at 3:46

Attachments:

from odbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 26, 2024
> The MSSQL database I'm using already has data in latin1. ...

If you data is stored in char fields and encoded in latin1, then 
code.google.com/p/odbc won't help you to convert it into utf8. The driver only 
converts ansii in char and utf16 in nchar into Go utf8 strings. You need to use 
some other package to convert latin1 to utf8. Sorry.

Alex

Original comment by [email protected] on 15 Nov 2013 at 5:51

from odbc.

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.