Resolved ANSI Encoding?

Discussion in 'Mac Apps and Mac App Store' started by k2spitfire88, Feb 16, 2011.

  1. k2spitfire88, Feb 16, 2011
    Last edited: Feb 16, 2011

    k2spitfire88 macrumors 6502

    Joined:
    Feb 15, 2008
    Location:
    in your mind
    #1
    I'm using my work mac, and trying to write some scripts for Windows to use, particularly using diskpart in the Win PE Command prompt. The issue I am running into, is diskpart (from what I've read) doesn't like the "Unicode" encoding that Text Edit likes to use. It needs ANSI, I believe. Does anyone know of any text editor for Mac that allows you to use ANSI encoding? I could use Windows, but I would prefer not to switch machines or fire up parallels every time I need to do some scripting...

    Thanks for your help! (I'm new to the scripting game, so if I'm not making any sense, just let me know, and I will do my best to clarify).
     
  2. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    Use TextEdit, switch to "Plain Text", and in the "Save" dialog you can choose the encoding. (Look for "Western" + "Windows").
     
  3. k2spitfire88 thread starter macrumors 6502

    Joined:
    Feb 15, 2008
    Location:
    in your mind
    #3
    There is an option for Western (Windows Latin 1). Is that what you are referring to?
     
  4. bredell macrumors regular

    Joined:
    Mar 30, 2008
    Location:
    Uppsala, Sweden
    #4
    TextEdit supports a large number of text encodings. After you've started TextEdit, choose the menu "Format > Make Plain Text". Then, when you choose "Save As" you can select the encoding you want. If the encoding you want is not in the list, choose "Customize Encodings List" and select the one you want.

    If you're only using standard english characters you can probably use the encoding "Western (Windows Latin 1)". If that doesn't work, try the encoding "Latin-US (DOS)".
     
  5. k2spitfire88 thread starter macrumors 6502

    Joined:
    Feb 15, 2008
    Location:
    in your mind
    #5
    Thanks for your help guys, but it doesn't appear to be working. I may be doing something wrong with the script itself, but I'm not sure, seeing as I know very little about it. I guess I'll try writing it from Windows and going from there.
     
  6. k2spitfire88 thread starter macrumors 6502

    Joined:
    Feb 15, 2008
    Location:
    in your mind
    #6
    I figured out why it wasn't working, and boy do I feel dumb now...

    In diskpart, to use a script, you type in diskpart /s < scriptname>.txt
    and it runs the script.

    I had the diskpart command in the beginning of the script. Deleted it and it ran fine! Thanks again!
     
  7. Guiyon macrumors 6502a

    Joined:
    Mar 19, 2008
    Location:
    North Shore, MA
    #7
    If you are moving between Mac OS X and Windows, another thing to watch for is newlines. In Windows CRLF is used as the newline 'character' and in Mac OS X LF is used as a newline. Some Windows apps/tools don't respond well to text files that use LF instead of CRLF (notepad immediately comes to mind).
     
  8. k2spitfire88 thread starter macrumors 6502

    Joined:
    Feb 15, 2008
    Location:
    in your mind
    #8
    Thanks for the info. I had seen that also, so I'm using Textwrangler, and using the CRLF option for line breaks. Hopefully that helps.
     

Share This Page