Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. XML / XSL
  4. UTF character encoding ...

UTF character encoding ...

Scheduled Pinned Locked Moved XML / XSL
xmlhelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am writing a facility in vb6 to export a number of records to an xml file that will then be sent to an organisation for processing. In the example of how they want the xml document to look they use ... <?xml version="1.0" encoding="UTF-16"?> However, when I go to view my document in MS Internet Explorer(6.0), I receive the following error ... The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Switch from current encoding to specified encoding not supported. Error processing resource 'file:///G:/Temp/104749-031001.xml'. Line 1, Position 40 Removing the encoding let's me view the document correctly, so is the UTF encoding absolutely necessary and does it affect the document if it's used on another machine or os? Matthew Live to ride. Ride to live.

    R M 2 Replies Last reply
    0
    • L Lost User

      I am writing a facility in vb6 to export a number of records to an xml file that will then be sent to an organisation for processing. In the example of how they want the xml document to look they use ... <?xml version="1.0" encoding="UTF-16"?> However, when I go to view my document in MS Internet Explorer(6.0), I receive the following error ... The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Switch from current encoding to specified encoding not supported. Error processing resource 'file:///G:/Temp/104749-031001.xml'. Line 1, Position 40 Removing the encoding let's me view the document correctly, so is the UTF encoding absolutely necessary and does it affect the document if it's used on another machine or os? Matthew Live to ride. Ride to live.

      R Offline
      R Offline
      Retsof Nawor
      wrote on last edited by
      #2

      The encoding attribute in the XML processing instruction is to indicate the encoding of the document, so it is likely that the document you are creating is not in that encoding hence the error. To check this look at the xml file you are creating in a hex editor, in utf-16 there are (at least) two bytes per character...

      1 Reply Last reply
      0
      • L Lost User

        I am writing a facility in vb6 to export a number of records to an xml file that will then be sent to an organisation for processing. In the example of how they want the xml document to look they use ... <?xml version="1.0" encoding="UTF-16"?> However, when I go to view my document in MS Internet Explorer(6.0), I receive the following error ... The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Switch from current encoding to specified encoding not supported. Error processing resource 'file:///G:/Temp/104749-031001.xml'. Line 1, Position 40 Removing the encoding let's me view the document correctly, so is the UTF encoding absolutely necessary and does it affect the document if it's used on another machine or os? Matthew Live to ride. Ride to live.

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        If you write encoding="UTF-16", the file needs to actually be in UTF-16. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber #include "witty-quote.h"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups