code: private boolean needUtf8Marker(CmsResource res) {
  
          if (!m_addByteOrderMark) {
              return false;
          }
          // if the encoding of the resource is not UTF-8 return false
          String encoding = CmsLocaleManager.getResourceEncoding(m_cms, res);
          boolean result = false;
          if (CmsEncoder.ENCODING_UTF_8.equals(encoding)) {
              try {
                  I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(res.getTypeId());
                  if (resType instanceof CmsResourceTypeJsp) {
                      result = true;
                  } else if (resType instanceof CmsResourceTypePlain) {
                      result = true;
                  } else if (resType instanceof CmsResourceTypeXmlContent) {
                      result = true;
                  } else if (resType instanceof CmsResourceTypeXmlPage) {
                      result = true;
                  }
              } catch (CmsLoaderException e) {
                  LOG.debug(e);
              }
          }
          return result;
      }
docs: Checks if the resource type needs an UTF-8 marker.<p>
  
  If the encoding of the resource is "UTF-8" and the resource
  type is one of the following:<br/>
  <ul>
  <li>{@link CmsResourceTypeJsp}</li>
  <li>{@link CmsResourceTypePlain}</li>
  <li>{@link CmsResourceTypeXmlContent}</li>
  <li>{@link CmsResourceTypeXmlPage}</li>
  </ul>
  
  it needs an UTF-8 marker.<p>
  
  @param res the resource to check if the content needs a UTF-8 marker
  
  @return <code>true</code> if the resource needs an UTF-8 maker otherwise <code>false</code>