I'm trying to load csv file to redshift table using copy command.

Special symbols like pound £ in varchar columns are converted to question mark "?" (which is default with redshift). How to copy over the special symbols as well?

below is my aws copy command

COPY public.sales FROM 's3://mybucket/salesfile.csv' iam_role 'arn:aws:iam::99999999999:role/RedShiftRole' delimiter ',' ignoreheader 1 acceptinvchars

1 Answers

1
Joe Harris On

Has your data been extracted from SQL Server? If so it's likely in UTF-16LE and you need to add that as a parameter in your COPY.

COPY public.sales 
FROM 's3://mybucket/salesfile.csv' 

ENCODING UTF16LE

IAM_ROLE 'arn:aws:iam::99999999999:role/RedShiftRole' 
DELIMITER ',' 
IGNOREHEADER 1 
ACCEPTINVCHARS

https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-conversion.html#copy-encoding