title: OData4j exceptions - "Odd number of characters" and "bad valueString part of keyString"
body: <p><strong>EDIT:</strong></p>
  
  <p>The solution was to make a view that mirrored the table in question and converted the date to varchar and then convert it back to date with a matching collation</p>
  
  <p><strong>END OF EDIT</strong></p>
  
  <p>Can anyone tell me why OData4j reads datetime values fine from one of my WCF Data Service server but runs into an illegal argument exception (bad valueString as part of keyString) when reading exact same datetime type with same format from another WCF Data Service?</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: bad valueString
    [datetime'2012-01-24T14%3A57%3A22.243'] as part of keyString</p>
  </blockquote>
  
  <p>The other problem is that when I ask for a JSON response from the service from which OData4j had no problem reading datetime types I get another illegal argument exception and the error message is - Odd number of characters.</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException:
    org.odata4j.repack.org.apache.commons.codec.DecoderException: Odd
    number of characters.</p>
  </blockquote>
  
  <p>Because WCF Data Services can't have multiple sources, I've made 2 projects with each it's own Entity Data Model source (from existing database). And like I mentioned above, I'm getting these annoying errors.</p>
  
  <p>To conclude...</p>
  
  <p>Example 1: bad valueString as part of keyString - when reading datetime. Also happens with <code>FormatType.JSON</code>.</p>
  
  <pre><code>ODataConsumer customerInfoServices = ODataConsumer
                                       .newBuilder("http://10.0.2.2:41664/CustomerInfoWCFDataServices.svc/")
                                       .setFormatType(FormatType.ATOM)
                                       .build();
  
  customer = customerInfoServices
             .getEntities("Customers")
             .select("name, id")
             .filter("id eq " + 5)
             .execute()
             .firstOrNull();
  </code></pre>
  
  <p>Example 2: Odd number of characters. Only happends with <code>FormatType.JSON</code> and no problem reading datetime.</p>
  
  <pre><code>ODataConsumer businessServices = ODataConsumer
                                   .newBuilder("http://10.0.2.2:35932/BusinessWCFDataServices.svc/")
                                   .setFormatType(FormatType.JSON)
                                   .build();
  
  Enumerable&lt;?&gt; ordrer = businessServices
                         .getEntities("Orders")
                         .filter("custId eq " + customer.getProperty("id").getValue())
                         .execute();
  </code></pre>
  
  <p>What I want is to receive JSON responses (ATOM is still too bloaded for android) and no problems reading datetime properties.</p>
  
  <hr>
  
  <p>No body able to help me?</p>
  
  <p>I've been wearing my fingers down trying to find a solution on Google, without any luck.</p>
  
  <p>The collation on the database without datetime problems is "Danish_Norwegian_CI_AS" and on the  database with reading errors is "SQL_Danish_Pref_CP1_CI_AS". I don't know if this has any meaning but I have a suspescion it has something to do with it.</p>