1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python sqlalchemyでoracleに接続しようとするとUnicodeDecodeErrorが出る

Last updated at Posted at 2019-11-27

Python3.7 sqlalchemyでoracleに接続しようとしたら下記エラーが出てしまった。
cx_Oracle単体ではoracleに接続できているようなので何が原因がよくわからなかった。

なかなか情報にたどり着けず、
encodingとかcharsetとかずいぶん遠回りしたので記載しておきます。

参考)
http://blog.kzfmix.com/entry/1361525164

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 11: invalid start byte

下記をpyのソースに埋め込んでエラーが解決した。

import  os
os.environ["NLS_LANG"] = "JAPANESE_JAPAN.AL32UTF8"
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?