August 4, 2015 at 11:18 am
Hi All,
I'm building a SP that uses the BCP command to create a file with the -w option.
I then am able to load the file into a table using the same options.
What I'm trying to understand is the following:
When I open the file in TextPad, I see the file type as Unicode
When I open the file in editpad pro, I see the file type as UTF-16
reading on the web, If I understand correctly, BCP -w spits out files that are UTF-16LE... Is this correct?
based on , the difference between UTF-16 and UTF-16LE is:
"UTF-16 and UTF-32 use code units that are two and four bytes long respectively. For these UTFs, there are three sub-flavors: BE, LE and unmarked. The BE form uses big-endian byte serialization (most significant byte first), the LE form uses little-endian byte serialization (least significant byte first) and the unmarked form uses big-endian byte serialization by default, but may include a byte order mark at the beginning to indicate the actual byte serialization used.
"
How does this affect our SQL Servers?
This can only affect developers if they read the files, right? or does affect the tables that are loaded by the bcp?
Thanks
JG
February 4, 2019 at 12:03 pm
JohnG69 - Tuesday, August 4, 2015 11:18 AMI'm building a SP that uses the BCP command to create a file with the -w option.
When I open the file in TextPad, I see the file type as Unicode
When I open the file in editpad pro, I see the file type as UTF-16
If I understand correctly, BCP -w spits out files that are UTF-16LE... Is this correct?Based on http://unicode.org/faq/utf_bom.html, the difference between UTF-16 and UTF-16LE is:"UTF-16 and UTF-32 use code units that are two and four bytes long respectively. For these UTFs, there are three sub-flavors: BE, LE and unmarked. The BE form uses big-endian byte serialization (most significant byte first), the LE form uses little-endian byte serialization (least significant byte first) and the unmarked form uses big-endian byte serialization by default, but may include a byte order mark at the beginning to indicate the actual byte serialization used."
How does this affect our SQL Servers?
This can only affect developers if they read the files, right?
or does it affect the tables that are loaded by the bcp?
Hello JG.
Hopefully this info helps, even if it has been 3.5 years 🙂 .
For more info on working with collations, please visit: Collations Info
Take care, Solomon...
SQL# — https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
Sql Quantum Lift — https://SqlQuantumLift.com/ ( company )
Sql Quantum Leap — https://SqlQuantumLeap.com/ ( blog )
Info sites — Collations • Module Signing • SQLCLR
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply