File Encoding Conversion

  • Does anyone have a script to convert a file with UTF-8 encoding to UNICODE? Any help will be appreciated.

  • EMtwo - Tuesday, October 30, 2018 1:50 PM

    Does anyone have a script to convert a file with UTF-8 encoding to UNICODE? Any help will be appreciated.

    That's not something you generally do with T-SQL.   You could far more easily find something in VBScript or other procedural languages that can handle such a task far better than T-SQL could, somewhere on the web.   Even Notepad++ might be a good option.   The question, of course, is what part of your overall solution does this task represent, and are there limitations on where said program would need to run?   You have to be somewhat careful with existing executables that are downloaded from the web.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • True! Not all web recommendations for solutions are safest.

  • EMtwo - Tuesday, October 30, 2018 1:50 PM

    Does anyone have a script to convert a file with UTF-8 encoding to UNICODE? Any help will be appreciated.

    UTF-8 is UNICODE.  UTF stands for UNICODE Transformation Format.  Did you need UTF-16 or UTF-32?

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Thank you for your response; I'm not sure. My purpose for wanting to do this conversion is to automate data load from a .csv file into a SQL server database table Using Bulk Insert. The extract file is in UTF-8 encoding which I am not sure Bulk insert supports - I stand to be corrected if I'm wrong. I have had to manually save the extract/.csv file with Unicode encoding.(see attached image) in order to load the data seamlessly. If I am able to convert the file from UTF-8, my automation can work smoothly.
    I'm not sure if this "Unicode" is UTF-16 or UTF-32.

  • drew.allen - Tuesday, October 30, 2018 3:16 PM

    EMtwo - Tuesday, October 30, 2018 1:50 PM

    Does anyone have a script to convert a file with UTF-8 encoding to UNICODE? Any help will be appreciated.

    UTF-8 is UNICODE.  UTF stands for UNICODE Transformation Format.  Did you need UTF-16 or UTF-32?

    Drew

     UTF-16.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply