새소식

DB

[MSSQL, BCP] invalid byte sequence for encoding "UTF8"

  • -
728x90

👨‍💻 Thank you for your blog visit!

It's a good day. Bro.

We will deal with the problem of "invalid byte sequence for encoding "UTF8" when using BCP commands in MSSQL.

🎯 Cause of error

Encoding issues for a character

ex) 0xba

 

🎯 Solution

When writing the bcp command, enter the -C 65001 option.

bcp "SELECT * FROM test" queryout "E:\test.csv" -S 192.168.0.1,1433 -U test -P 1234 -E -c -C 65001

If your MSSQL version is low, you won't be able to use that option.

-> Code page 65001(UTF8) does not support for SQL Server 2012 (damn..)

-> You can change the encoding in Windows Notepad.

In my experience, this is the simplest way.

블로그 방문해주셔서 감사합니다.

도움이 되셨으면 '좋아요'를 눌러주세요!
추가로 질문사항이 있으면 댓글 남겨주세요 :)

💯포스트 후원하기
 

인공지능이 추천하는 10개의 게임!

보물처럼 숨겨진 게임을 발굴하자! 게이머엑스포 유저들은 누구나 게임 발굴 대회에 참여 가능합니다. 게임 발굴 대회에서 입상한 게임은 2023 에디터 추천 TOP100에 노출됩니다. 단순 조회, 게임

 

 

 

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.