Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
BizTalk GroupsView
Biztalk General
Biztalk Orchestration

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft Biztalk General Posts  Ask A New Question 

Hi Felix,Are you sure the problem is in the output file, and not that the

Tomas Restrepo [MVP] posted on Monday, January 14, 2008 2:05 PM

Hi Felix,

Are you sure the problem is in the output file, and not that the characters
got corrupted during input from another source?

Also, what happens if you try other encodings (like one of the unicode
ones)? Do they appear correctly?


--
Tomas Restrepo
http://www.devdeo.com/
http://www.winterdom.com/weblog/
reply

 

Flat File Assembler Encoding Problem

F.Mondelo - http://felixmondelo.blogspot.com/ posted on Thursday, January 17, 2008 2:52 AM

Hi, I'm trying to assemble a flat file with target charset iso-8859-1.
I use XMLNorm.TargetCharset message context property for that.

The target file encoding is right, but spanish characters (N tilde, U
umlaut, ...) is represented with question marks (3F in hexadecimal).

Anyone has a solution for this issue?
reply

I have a solution that works for now, but is not using TargetCharsetfrom flat

F.Mondelo - http://felixmondelo.blogspot.com/ posted on Thursday, January 17, 2008 2:52 AM

I have a solution that works for now, but is not using TargetCharset
from flat file assembler. I have done a custom pipeline component that
calls flat file assembler and then converts the result into
iso-8859-1:

protected override IBaseMessage Assemble(IPipelineContext pc)
{
IBaseMessage retMsg = _assembler.Assemble(pc);
System.Text.Encoding encoder =
System.Text.Encoding.GetEncoding("iso-8859-1");

byte[] buffer = new byte[1024];
byte[] destBuffer = new byte [1024];
System.IO.Stream strm = retMsg.BodyPart.Data;
VirtualStream vStrm = new VirtualStream();

while (strm.Read(buffer, 0, 1024) > 0)
{
destBuffer = System.Text.Encoding.Convert
(Encoding.UTF8, encoder, buffer);
vStrm.Write(destBuffer, 0, destBuffer.Length);
}

retMsg.BodyPart.Data = vStrm;
retMsg.BodyPart.Data.Position = 0;

return retMsg;
}

This works, I mean, after flat file assembler the output file is
correct in utf-8 (for example, N tilde is represented by bytes C3 91)
and then I can convert it to iso-8859-1 (N tilde is converted from C3
91 to D1), but if I use directly XMLNORM.TargetCharset = "iso-8859-1",
after assembler I get spanish characters as question marks (byte 3F).

I think the problem is with assembler encoding, because without set
any charset (utf-8 by default) it works correctly.
reply