I am creating files with xp_cmdshell like this:
SELECT @command = 'echo ' + @fileContent + ' > e:\out\' + @fileName + '.csv'
exec master.dbo.xp_cmdshell 'mkdir "e:\out\"'
exec master..xp_cmdshell @command
The problem is that the file contents is not in UTF-8 and so some special characters are wrong.
Can i create the file in UTF-8 encoding?