Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3488740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:18:28+00:00 2026-05-18T11:18:28+00:00

We just came across an interesting issue which we face during unit testing of

  • 0

We just came across an interesting issue which we face during unit testing of the response flow of a message transformation.
The outcome of this flow is an (XML to NON XML)Binary output which is put on the queue.
The issue we are facing is:
The length of this binary output message doesn’t match with that of the non-xml data, which we save as our expected result from the MFL format tester tool. Our inference is that OSB internally applies some encoding to this message which by the looks of it is UTF-8 present in Proxy/Business Service. So we changed the encoding of the expected to UTF-8 and the test case was successful. But on close investigation it was found that
UTF-8 by its own virtue does not represent all the data correctly. Where ever there is a data loss it is represented with a ‘? ‘ symbol.
Hence our comparison is incorrect even though the JUNIT test case passes.

And also there is MQ in between which might have its own encoding, which we are unable to rule out at this moment.

We can think of two solutions to this:
1. We can implement the Comparison by converting both the expected and obtained into a Byte[] to avoid any encoding issues. But we are unable to obtain the exact message length in the output.
2. We can encode both expected and obtained result into a common encoding format other than UTF-8, but we are not sure which, and then do the comparison.

Any ideas gang?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:18:29+00:00Added an answer on May 18, 2026 at 11:18 am

    You are likely not experiencing data loss when you look at the UTF-8 encoded binary data and see a question mark (?). Odds are much better that you have a incomplete font set installed on your computer and there is no character to display the particular unicode character specified in the file. There is a smaller chance that your binary to UTF-8 conversion routine is using a character which lacks a glyph.

    If the binaries didn’t match, you should have fixed the problem there. Odds are that one of the binaries encodes an end of string sequence, end of file sequence, an end of transmission sequence, or some set of bits which confuses a program into thinking it’s done when more data is actually present).

    Either that or you are incorrectly casting a binary into a string sequence. Binary comparisons should be made at the byte level, and in Java you can’t assume bytes == chars.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just came across a very interesting issue. If I use ViewData to pass
I just came across an interesting situation in JavaScript. I have a class with
I just came across an interesting scenario. I have a class in C#: public
I just came across the interesting problem of trying to trim the leading zeroes
I just came across Google Native Client Now, it looks really interesting that they
Just came across the Doctrine Project which has an Object Relational Mapper and a
I just came across some code which declares a struct within a C++ class
Just came across this quote in a book on OOP that I'm reading, A
Just came across this website . Feature 9 is memory management and they claim
I just came across this code and a few Google searches turn up no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.