title: Strip BOM from a generated string (not a file)
body: <p>I'm working with strings that look like they're MS Office documents. Note in this example, there are two BOM "characters," one at the start of the string and one in the body. Sometimes there are several of the characters, sometimes none. In the Powershell console, they print as ?</p>
  
  <pre><code>ï»¿&lt;html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"&gt;&lt;head&gt;&lt;meta http-equiv=Content-Type content="text/html; charset=unicode"&gt;&lt;meta name=Generator content="Microsoft Word 14 (filtered medium)"&gt;&lt;style&gt;&lt;!--
  /* Font Definitions */
  @font-face
      {font-family:Calibri;
      panose-1:2 15 5 2 2 2 4 3 2 4;}
  /* Style Definitions */
      &lt;snip - bunch of style defs&gt;
  --&gt;&lt;/style&gt;&lt;/head&gt;&lt;body lang=EN-US link=blue vlink=purple&gt;&lt;div class=WordSection1&gt;
  &lt;p class=MsoNormal style='text-autospace:none'&gt;
   &lt;span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'&gt;ï»¿&lt;/span&gt;
   &lt;span style='font-size:12.0pt;font-family:"Times New Roman","serif"'&gt;Testing &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
  &lt;/p&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>The strings come from an object, so I can't simply force UTF8 encoding with Get-Content. How else might I strip them? I'm not worried about this being lossy, as this is just being piped to the display, thus the desire to strip the extra characters. I'll also be stripping the HTML.</p>