geekswithblogs.net
HOME
ARCHIVES
CONTACT
LOGIN
El Grego
BizTalk blog
News
My Stats
Posts - 26
Comments - 25
Trackbacks - 55
Twitter
gvdwiele
Error: 18456, severity 14, state 16...digging
about 61 days ago
gvdwiele
Configuring a BizTalk WCF Static Port to Behave as a Dynamic Port WITH NACKS. Aint easy.
about 159 days ago
gvdwiele
Grandpa is debugging with Stan Getz.
about 171 days ago
gvdwiele
looking into Ivy, the dependency manager ;-)
about 173 days ago
gvdwiele
watching the $ fall
about 243 days ago
gvdwiele
refactoring to patterns...or how one 500-line cs file can turn into 50 classes of 20 lines.
about 264 days ago
gvdwiele
refactoring to patterns...or how one 500 cs file can turn into 50 classes of 20 lines.
about 264 days ago
gvdwiele
I'm selling my Apple stock.
about 268 days ago
Recent Comments
Excellent article. I guess, the following sample s...
by Sreeni Nutulapati
Thank you for posting this. It helped me a lot. I ...
by Marcus Nyberg
I'm fully trained and good at throwing things out....
by Grego
What FFASM bug?!!! You cannot just throw that out ...
by Mikael Sand
No bother. Glad it was of use. Your audit trail ap...
by Grego
Recent Posts
CharacterTranscoder pipeline component on github.com
Question marks in your flatfile output CONTINUED
Question marks in your flatfile output?
BizTalk Arbitrary Binary Email Attachments (or how to fix unreadable attachments)
BAM Typed API alternative
Archives
September, 2009 (1)
August, 2009 (2)
July, 2009 (1)
June, 2009 (2)
May, 2009 (2)
February, 2009 (1)
December, 2008 (1)
September, 2005 (2)
April, 2005 (1)
March, 2005 (2)
February, 2005 (1)
November, 2004 (4)
October, 2004 (2)
September, 2004 (4)
Post Categories
BizTalk - EAI - B2B
<< Question marks in your flatfile output?
|
Home
|
CharacterTranscoder pipeline component on github.com >>
Question marks in your flatfile output CONTINUED
In order to get the FFASM encoding bug looked at, Microsoft Support asked me to call an 0800 number and provide payment info :-(
Since I am still convinced every bug should be reported I will try again next month when I have my client's support contract details (the guy with the info is on a very long summer holiday :).
In the mean time I have developed a custom fix which you may use at your own risk...
This
TranscodingStream
class is a binary transformation stream decorator: while reading, the underlying bytes are transcoded on the fly from a source to a target encoding. Both source and target encoding are configurable.
You can make your own pipeline component that replaces the incoming message its bodypart stream by this TranscodingStream (and a context property to dynamically set the target encoding). In fact I have built it already, if you want it just let me know.
This way you can leave the FFASM to its default (UTF8) and let this new component do the work right-after. Also mind that the TranscodingStream doesn't prefix a BOM, which could be problem for UTF-16 (for the simple reason I didn't need it, like in YAGNI).
In retrospect my stream decorator could have been done a bit better. It violates the
single responsibility principle
since it does decoding + encoding in 1 step. This explains the Read's method cyclomatic complexity being too high. A cleaner design would have been: DecodingStream decorator that translates whatever source encoding to Unicode + EncodingStream decorator that translates Unicode to whatever target encoding.
posted @ Thursday, August 06, 2009 3:19 AM | Filed Under [
BizTalk - EAI - B2B
]
Comments
No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
Remember Me?