Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

ANSI to UTF-8 conversion Expand / Collapse
Author
Message
Posted Thursday, April 11, 2013 6:50 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:23 AM
Points: 7,098, Visits: 12,605
I am pretty sure I tried it before posting but that code has long since evaporated. I'll try it again though. Chances are I was using 2012 too so I'll fire that up and try 2005 too. Things may have gotten better.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1441216
Posted Thursday, April 11, 2013 7:33 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:23 AM
Points: 7,098, Visits: 12,605
...on hold...

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1441246
Posted Thursday, April 11, 2013 7:36 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:42 PM
Points: 1,787, Visits: 5,696
Thanks for that - will take a look.

Much appreciated.


MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1441251
    Posted Thursday, April 11, 2013 7:43 AM


    SSCertifiable

    SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

    Group: General Forum Members
    Last Login: Today @ 9:23 AM
    Points: 7,098, Visits: 12,605
    I just realized something...converting a file from ANSI to UTF-8 is pretty much non-sensical unless you truly need the BOM. UTF-8 covers all 255 ANSI characters with the same exact code points. The SSIS flat file team could have been nice enough to put in the BOM, but they didn't, but basically no conversion should be necessary as most UTF-8 parsers say the BOM Is optional.

    __________________________________________________________________________________________________
    There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
    Post #1441254
    Posted Thursday, April 11, 2013 7:46 AM


    SSCertifiable

    SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

    Group: General Forum Members
    Last Login: Today @ 9:23 AM
    Points: 7,098, Visits: 12,605
    mister.magoo (4/11/2013)
    Thanks for that - will take a look.

    Much appreciated.

    If you did happen to grab the download before I took it down, don't bother looking. I was misreading the BOM in my output file. The code I posted outputs UTF-16LE, not UTF-8.


    __________________________________________________________________________________________________
    There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
    Post #1441257
    Posted Thursday, April 11, 2013 8:24 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 12:42 PM
    Points: 1,787, Visits: 5,696
    opc.three (4/11/2013)
    I just realized something...converting a file from ANSI to UTF-8 is pretty much non-sensical unless you truly need the BOM. UTF-8 covers all 255 ANSI characters with the same exact code points. The SSIS flat file team could have been nice enough to put in the BOM, but they didn't, but basically no conversion should be necessary as most UTF-8 parsers say the BOM Is optional.


    Unfortunately, in my case, the party on the other end of the conversation require the BOM.

    Thanks for looking anyway, the horrible script hack works and is quick enough now that it's not a problem.


    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1441278
    « Prev Topic | Next Topic »

    Add to briefcase ««12

    Permissions Expand / Collapse