Skip to main content
Question

BULK LOAD UTF-8 type (Arabic or Persian) data

  • February 4, 2017
  • 1 reply
  • 6 views

lop2lop
Forum|alt.badge.img

Hello everyone.
When I try to Bulk Load data in UTF-8 type (Arabic or Persian) using COPY FROM STDIN, it converts Arabic or Persian characters to question marks !

My COPY statement is :
COPY Person_T(ID,fName,lName) FROM STDIN RECORD TERMINATOR E'\n' DELIMITER E'\t' ENFORCELENGTH NO COMMIT;

In INSERT or UPDATE statement it works great but COPY not.

I set Locale to fa_IR using SET LOCALE TO fa_IR; but nothing changed.

Is there any chance ?

thanks.

1 reply

lop2lop
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • February 4, 2017

I found the solution by myself :# .

My problem was that I used
byte[] buff = Encoding.Default.GetBytes(sbText.ToString());

instead of
byte[] buff = Encoding.UTF8.GetBytes(sbText.ToString());