Comments (6)
there is a way to define custom encode and decode through implement IStringConveter interface and pass this value to connection after connect
now I am upgrading this to be used directly with database/sql package.
also i will try to add support for charset 846 to the package
from go-ora.
v2.7.18
add support for charset ID 846 and also update code to use SetStringConverter
from go-ora.
Thanks, but still panics.
Should I omit charset ID in DSN?
panic: charset KO16MSWIN949 is not supported by the driver
goroutine 1 [running]:
main.main()
---/ledger/example/go-ora/main.go:36 +0x23f
exit status 2
go-ora/v2/connection_string.go
Line 272 in 47c7295
from go-ora.
yes don't use charset in dsn as you are using the same charset of the server
if there is panic would you please share an example code
from go-ora.
Oh, I tried with SetStringConverter
and it worked.
But I'm just not sure it is correct implementation. Can you correct me if I'm wrong?
Now I think I can replace go-ora, which I had to change encoding every message manually. Thanks!
import (
"context"
"database/sql"
"encoding/base64"
"github.com/davecgh/go-spew/spew"
go_ora "github.com/sijms/go-ora/v2"
"github.com/sijms/go-ora/v2/converters"
"golang.org/x/text/encoding/korean"
)
// Server configuration
// NLS_NCHAR_CHARACTERSET ,AL16UTF16
// NLS_CHARACTERSET ,KO16MSWIN949
type KO16MSWIN949Converter struct {}
func (KO16MSWIN949Converter) Encode(in string) []byte {
v, err := korean.EUCKR.NewEncoder().String(in)
if err != nil {
panic(err)
}
return []byte(v)
}
func (KO16MSWIN949Converter) Clone() converters.IStringConverter {
return KO16MSWIN949Converter{}
}
func (KO16MSWIN949Converter) GetLangID() int {
return 846
}
func (KO16MSWIN949Converter) Decode(in []byte) string {
v, err := korean.EUCKR.NewDecoder().Bytes(in)
if err != nil {
panic(err)
}
return string(v)
}
go_ora.SetStringConverter(db, KO16MSWIN949Converter{}, nil)
from go-ora.
the implementation is correct
also test my update if it is working or not
i update connection_string.go and un-comment the line
from go-ora.
Related Issues (20)
- New issue with REF CURSOR HOT 2
- Oralce 23c wallet support. HOT 8
- Can't support BFILE type for the bulk insert HOT 2
- BLOB limited to 32kB HOT 3
- Issue in parseSqlText function HOT 1
- Client timezone is not honored? HOT 9
- PGA memory leak with LOBs (Regression) HOT 12
- Readme Output Parameters Example Does Not Work HOT 3
- ORA-01013 Error occurs seemingly randomly running a queries in a loop HOT 3
- Query panic HOT 12
- Driver Character Set support Issue HOT 4
- Regression since v2.7.23 when using DBMS_AQ.DEQUEUE_ARRAY HOT 2
- Add support for Oracle proxy users HOT 6
- v2.7.25 now requires Go v1.21? HOT 3
- TTC error: received code N during response reading (v2.7.26) HOT 11
- Wrong values with characterset KO16MSWIN949 HOT 11
- Error when using `sql.NullIntX` types for output parameters. HOT 1
- v2.8.2 ORA-01756: 撘訫噡??摮㛖泵銝脫瓷?㗇迤蝖桃??? HOT 2
- Problem with CLOB type input parameters. HOT 4
- Getting EOF Error while pinging database connection with password having secial character '@' HOT 5
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 go-ora.