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 123»»»

Convert file from ANSI to UNICODE Expand / Collapse
Author
Message
Posted Friday, April 5, 2013 8:10 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, August 17, 2014 3:50 AM
Points: 329, Visits: 858
Currently, we generate file in ANSI. Is there a setting we need to change to generate files in UNICODE? or how can we convert ANSI files to UNICODE?
Post #1439240
Posted Friday, April 5, 2013 8:16 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 10:01 AM
Points: 1,787, Visits: 5,697
Based on the little information you have provided, no.

How do you produce the ANSI file? SSIS? BCP? Copy and paste?


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 #1439246
    Posted Friday, April 5, 2013 8:17 AM
    Old Hand

    Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

    Group: General Forum Members
    Last Login: Sunday, August 17, 2014 3:50 AM
    Points: 329, Visits: 858
    Sorry. Yes BCP.
    Post #1439247
    Posted Friday, April 5, 2013 8:23 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 10:01 AM
    Points: 1,787, Visits: 5,697
    Have you tried the "-w" switch?

    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 #1439253
    Posted Friday, April 5, 2013 8:45 AM
    SSC Veteran

    SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

    Group: General Forum Members
    Last Login: Thursday, August 28, 2014 5:14 AM
    Points: 289, Visits: 214
    -N will export char data as Unicode
    Post #1439260
    Posted Friday, April 5, 2013 8:47 AM
    Old Hand

    Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

    Group: General Forum Members
    Last Login: Sunday, August 17, 2014 3:50 AM
    Points: 329, Visits: 858
    so use both -W and -N switch? also, what would i see different in the file to confirm its in unicode?
    Post #1439261
    Posted Friday, April 5, 2013 8:54 AM
    SSChasing Mays

    SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

    Group: General Forum Members
    Last Login: Yesterday @ 4:02 AM
    Points: 646, Visits: 1,863
    The file size should double, for example, for a unicode file. (2 bytes per character.)

    A text editor such as Ultraedit would confirm (Ctrl-H)
    Post #1439264
    Posted Friday, April 5, 2013 9:13 AM
    Old Hand

    Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

    Group: General Forum Members
    Last Login: Sunday, August 17, 2014 3:50 AM
    Points: 329, Visits: 858
    ok Thanks...So, do I use both -w and -n ?
    Post #1439277
    Posted Friday, April 5, 2013 9:26 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 10:01 AM
    Points: 1,787, Visits: 5,697
    SQL_Surfer (4/5/2013)
    ok Thanks...So, do I use both -w and -n ?


    Something like this will produce Unicode output.

    bcp "select N'test' as test" queryout test.txt -w -T

    You can check the format of the output file produced by opening it in Notepad.exe, then choose File...Save As... and at the bottom of the dialog window will be the file type Unicode.


    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 #1439285
    Posted Friday, April 5, 2013 9:55 AM
    Old Hand

    Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

    Group: General Forum Members
    Last Login: Sunday, August 17, 2014 3:50 AM
    Points: 329, Visits: 858
    I generated the file with w option and it does look different than the file without w option. But I need to make sure if it is in Unicode format. I tried to open it in notepad then save as, The default encoding type is ANSI.
    Post #1439325
    « Prev Topic | Next Topic »

    Add to briefcase 123»»»

    Permissions Expand / Collapse