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: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
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

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1441216
Posted Thursday, April 11, 2013 7:33 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
...on hold...

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1441246
Posted Thursday, April 11, 2013 7:36 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 3:56 PM
Points: 1,654, Visits: 5,208
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: Wednesday, April 16, 2014 9:25 AM
    Points: 7,070, Visits: 12,523
    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

    Believe you can and you're halfway there. --Theodore Roosevelt

    Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

    The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

    1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
    Post #1441254
    Posted Thursday, April 11, 2013 7:46 AM


    SSCertifiable

    SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

    Group: General Forum Members
    Last Login: Wednesday, April 16, 2014 9:25 AM
    Points: 7,070, Visits: 12,523
    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

    Believe you can and you're halfway there. --Theodore Roosevelt

    Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

    The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

    1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
    Post #1441257
    Posted Thursday, April 11, 2013 8:24 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: 2 days ago @ 3:56 PM
    Points: 1,654, Visits: 5,208
    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