'Non English letters was not copied properly using BCP copy

I'm trying to copy csv to database table using bcp command. It's successfully copied, but the problem is non-English letters was migrated as some junk characters.

BCP query:

bcp "[table_name]" in "[file_path]" -F 1 -a 32768 -c -C RAW -t"|~|" -r "|\n|" -S "[server]" -U "[username]" -P "[password]" -d [database]

after migration

This is the source

Another Scenario:

When I use -C 65001 instead of -C RAW above issue is fixed. But I've fixed another bug that is opened again. Please help me on the same.

Source: enter image description here AfterMigration: enter image description here



Solution 1:[1]

I've found the solution to my problem. Previously I've used text and nvarchar data types in my destination tables. using -C 65001 the non English letters migrated properly for nvarchar columns not for text datatype. using -C RAW the non English letters migrated properly for text columns not for nvarchar datatype.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rabiul Aleem