Comments (3)
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.
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:
- [test - latin1.go](https://storage.googleapis.com/google-code-attachments/odbc/issue-26/comment-2/test - latin1.go)
from odbc.
> 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)
- DB2 for i: Simple select with empty ResultSet locks table HOT 1
- Compile errors when building from Windows OS with GOOS=linux HOT 2
- an error of SQL syntax error HOT 1
- Panic when binding `varchar`/`string` types: slice bounds out of range [:668] with capacity 256 HOT 3
- memory leak using rows.next() HOT 7
- signal 13 received but handler not on signal stack HOT 4
- Low max message length HOT 3
- Add tags to the repo HOT 1
- Implement QueryerContext interface HOT 1
- Implement RowsColumnTypeDatabaseTypeName HOT 1
- error when build from linux HOT 2
- only half of unicode string is inserted.
- Issue with Unixodbc-2.3.7 for master and for_issue_88 branch HOT 1
- 向 varchar字段保存中文中会被截断 HOT 8
- Maintain releases HOT 5
- The package is returning a panic instead of an error HOT 4
- Issues with parametrized queries Windows/DuckDB HOT 2
- abount microsoft access long binary data type HOT 1
- Unrecognized Data Type on Column
- random errors when doing the db.query using Denodo odbc driver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odbc.