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

lop2loplop2lop
edited February 2017 in General Discussion

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.

Best Answer

  • lop2loplop2lop
    Answer ✓

    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());

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file