How do I specify charset and line breaks in files?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luttkens
    New Member
    • Jul 2007
    • 23

    How do I specify charset and line breaks in files?

    I have an annoying problem that should be easy to solve.

    I need to create a file in ASCII-format (ISO-8859-1) with windows-line breaks <CRLF> and send it via FTP. I'm using PHP on a Linux server and the FTP-transfer is not a problem... The script files are encoded with UTF-8 .

    As I understand it the FTP-software might affect (change) the line breaks when transferring. Perhaps also the charset?

    Can anyone clarify how to create such file, send via FTP and make sure that it has the correct charset and line breaks after upload via FTP?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    1. ISO-8859-1 is not ASCII but Latin-1
    2. if your script file is encoded in UTF-8, you have to encode your output in ASCII
    3. if you want <CRLF> in the output, use "\r\n"

    Comment

    Working...