Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Set encoding

BizTalk 2006

This group is for all content related to BizTalk Server 2006. This includes a forum, samples, videos, labs, and tools. Most of the content here also applies to other versions of BizTalk beyond 2006.

Set encoding

  • rated by 0 users
  • This post has 9 Replies |
  • 1 Follower
  • Hi,

    How to set the encoding of the windows to ISO-8859-1? Right now encoding for the xml is windows 1252 and I want to change this to ISO-8859-1.

    I am not sure how is it work. Is there any place where I can learn about this encoding set up?

    XML file created in the biztalk from the flat file.

    Thank you

    Thank you, Siva
  • Siva,

    Can you clarify your question a bit? I'm not quite sure I understand precisely what you're asking, so it may be one of these:

    1) Do you mean how to set the encoding XML file produced by the Flat File Disassembler when parsing an incoming flat file? Or...

    2) Do you mean how to tell BizTalk to interpret an incoming Flat file in a specific encoding? Or

    3) Do you mean how to tell BizTalk to generate a Flat File (using the Flat File Assembler) using a specific encoding?

    If it's (1), then it is usually not an issue and I've never seen any specific way to change it (though at worst you could write a transcoding pipeline component).

    If it's (2), then look at this:,guid,537.aspx

    If it's (3), then look at the second part in this:

  • Hi,

    Thank you for your reply and sorry for posted an unclear question.

    I am moving projects from old server to new server. The old server has BizTalk 2004 and VS2003 and new has BizTalk 2006 and VS2005. I have to make sure that out puts are exact same.

    There are some projects, send xml to partners over the HTTP. The only different I seen in this new out put is encoding. The out put XML file encoding is ISO-8859-1 in old server and Window-1252 in the new server out put. How can I change the xml's encoding from Windows1252 to ISO-8859-1 in the new server? Where do I have to do this?

    Thank you in advance.


    Thank you, Siva
  • To change the encoding an XML message is generated in by BizTalk, you need to tell the XML Assembler in the send pipeline the target encoding you want using the "Target charset" property (or through the XMLNORM.TargetCharset context property).

  • Hi Siva.

    You should follow Tomas' advice for setting the Charset on the XML Assembler (in the above post).
    This will have the effect of re-encoding your message in the appropriate charset (Generally Charset is used to mean Encoding, which is different from Character Set but that's another story...!), and should also update the encoding attribute in the XML declaration to match.

    If you don't set an encoding for a message, and the message was created inside of BizTalk, then the default is UTF-8.

    But a quick question: Has the consumer of your XML actually specified an encoding of ISO 8859-1?
    Both Windows-1252 and ISO 8859-1 are standard encodings of the Latin alphabet (known as Latin-1).

    In fact, Windows-1252 is a superset of ISO 8859-1, and defines some characters (e.g. smart quotes) which don't exist in ISO 8859-1.
    Most windows-based web browsers (and email clients) treat ISO 8859-1 as Windows-1252 anyway.
    If your XML messages don't contain these characters, then the two charsets should be synonymous.

    So... if your client absolutely requires ISO 8859-1, then you should definitely use this encoding, as otherwise you're breaking a contract.

    But if they don't, why not use Windows-1252 (if your client is Windows-based), or (even better) a Unicode encoding?

    Plus, does the declaration at the top of the XML message match the encoding used?
    i.e. does your XML message say something like:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    But most importantly: why did the encoding change when you moved to BizTalk 2006?

    You're on the same version of windows, and as far as I know, BizTalk doesn't apply any sort of "default" encoding which could have changed.

    If you'd gone from ISO 8859-1 to UTF-8, that would be one thing.

    Were you using BizTalk 2004 without SP1? If so, this might help to explain things (there was a fix in SP1 which changed the default encoding for message to be Unicode).

    If you change your output encoding to be the same as your original system, might you not simply be hiding a different problem?

    Daniel Probert BizTalk Architect
  • Thank you for your reply and it gave me alot of ideas.

    The problem is my management doesnt want me to touch the project. They just want me to move the project from windows 200 with vs 2003 & biztalk 2004 to windows 2003 with vs 2005 and biztalk 2006. Plus they want exact same out put xml. 

    We dont have any biztalk's sp in windows 2000.

    How can I solve this issue?

    I want something like <?xml version="1.0" encoding="ISO-8859-1"?>  in my xml out put.  But I am getting <?xml version="1.0" encoding="Windows - 1252"?>

    Since I am new to biztalk and this B2B world, I dont have much knowladge about how these stuff works.

    Thank you in advace.

    Thank you, Siva
  • Well technically, moving from BTS2004 to BTS2006 is "touching the project"...

    However, I assume they mean that they don't want you touch any of the artifacts.

    You need to tell them that when you upgrade an application from BTS2004 to BTS2006, sometimes it's neccessary to change things in the application - in fact, in some cases it's necessary (e..g if you had a custom pipeline component written in .NET 1.1 you might have to change the code to work in .NET 2.0 - it depends in the sutuation).

    So, you have 2 choices the way I see it:

    1) Try Tomas' advice and modify the Target Charset property on the XML Assembler pipeline component - this will involve "touching the project"
    2) Work out what's changed in your environment to cause the encoding to change, and fix that - this (hopefully) won't involve "touching the project"

    Unfortunately it's unlikely anyone can help you with 2), unless they've faced exactly the same issue, as we don't know enough about the servers you're running on, and the application you're converting.


    Daniel Probert BizTalk Architect
  • I still can't see that any of you has answered to Siva's question? I am having the exact same problem. I know how to use the "Target charset" to change the encoding, but the problem is that ISO-8859-1 is not one of the options in BTS 2006! Why? And how to work around this (any ideas other than using Windows-1252)?
  • Anonymous; Have a look at the info in my longer post above - Windows-1252 is a superset of ISO 8859-1, so will work wherever ISO 8859-1 is required.

    At the moment we can't solve the problem as not enough information has been provided.
    AFAIK There's no simple answer - all w can do is provide pointers on things to try.
    Which has been done.

    When you say you have the "exact same problem" do you mean that you're trying to upgrade a solution from BTS 04 (No SP1) on Windows 2000 to BTS 06  on Windows 2003 and the default encoding is changing? Cause if not, you don't have exactly the same problem1

    There's a number of possibilities for this - given the fact that Siva mentioned that they weren't using SP1 on BTS 04, then moving to BTS06 will change the default encoding used.

    Have either of you tried setting the XMLNorm.TargetCharset context property to "ISO-8859-1" and seeing what result you got?

    Or using Tomas' FixEncoding pipeline component? 

    The list of Target Charsets is very limited, but that doesn't stop you from using unlisted (but supported) charsets - you simply have to set it from code. 

    If your boss says to you "You have to upgrade a BTS04 solution to a BTS06 solution without touching the project" you should say to them that that is not always possible. 





    Daniel Probert BizTalk Architect
  •  Thanks!  #3 was exactly what I needed.

Page 1 of 1 (10 items)