I am using perl v. 5.10.0 on a Vista 64 bit computer, trying to create a few lines in a file that I will later copy and paste into an XML file that uses UTF-8.

The XML file when viewed with "notepad" on a windows XP system shows what looks like text and arrow signs with a square between opposing arrow signs like this,,,,with [] representing the square.

___________________________________________________

lots of text>[]< lots of text>[]<lots of text

___________________________________________________

When viewed on a Vista machine using "notepad" you don't see the [] character and see instead a newline carriage return is displayed like this.

_________________________________________________

lots of text>

< lots of text>

<lots of text

__________________________________________________

I think the [] represents a char(13) character(10) i.e. \x0D \x0A i.e. I think x000D x000A . But maybe it needs to be sent differently because it is for a UTF-8 xml file.

I tried to copy just the [] character into a text file and then used

my @odaoutput= <ODOA>; print OUTFILE " some text>@odaoutput";
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Everything I try ends up looking like a line feed carriage return, even on the XP system. Never does it look like the original [] when viewed on the XP system. Can you help me please?


In reply to adding 0D 0A to a UTF-8 file. by Lukin4Love

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.