On Thu, Feb 2, 2012 at 4:07 PM, Christian MICHON
<[email protected]> wrote:
> On Thu, Feb 2, 2012 at 6:54 AM, Jeremy Evans <[email protected]> wrote:
>> On Feb 1, 2:22 pm, Christian MICHON <[email protected]>
>> wrote:
>>> On Wed, Feb 1, 2012 at 6:45 PM, Jeremy Evans wrote:
>>> > On Feb 1, 7:24 am, Christian MICHON wrote:
>>> >> Hi,
>>>
>>> >> I've a small app running on jruby and sequel, accessing H2 embedded
>>> >> databases through jdbc.
>>>
>>> >> I've plenty of germanic letters (like 0xD6 capital o with umlaut) I
>>> >> would need in my records, but when it goes as part of a string into my
>>> >> H2 db, I cannot get back the original content through queries.
>>>
>>> >> How to perform this? I am currently using jruby in 1.8 mode, and
>>> >> moving to 1.9 (in order to use force encoding plugin for example) is
>>> >> not an option yet.
>>>
>>> > Can you submit a self-contained example showing the problem,
>>> > preferably with an SQL log?  Note that Sequel doesn't monkey with
>>> > string encodings (unless you use the force-encoding plugin), and if
>>> > you are getting bad results in 1.8 mode, it may be due to lower layers
>>> > of the stack (jdbc, java, h2).
>>>
>>> sure Jeremy!
>>>
>>> You can find both source code and output in the following 
>>> pastie:http://pastie.org/3298600
>>>
>>> SQL log looks fine, which might mean it's H2 related. Not sure yet
>>> what is wrong here...
>>>
>>> More info on my setup:
>>> * jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572) (Java HotSpot(TM)
>>> Client VM 1.6.0_29) [Windows Vista-x86-java]
>>> * H2 1.3.162 (2011-11-26)
>>> * sequel 3.31.0
>>
>> I'll do some troubleshooting on this tomorrow, but it doesn't appear
>> to be caused by Sequel.  My guess is h2 is translating it to unicode
>> internally, and returning it in UTF-8 format.
>>
>
> Thanks. I also did some experiments this morning.
>
> Based on the log I attached in the pastie above, I tried to enter
> exactly the sql commands straight into H2 console, to see if H2 was
> responsible or not.
>
> Please note that logger reported sequel inserting the right content...
>
> (...)
> So I believe there might be a mismatch between what the logger
> reported and what truly was inserted in H2.
>

I did some more experiments just now, testing:
- jdbc + H2: FAIL
- jdbc + sqlite (sqlitejdbc-v056-pure.jar): FAIL
- using MRI, sequel (3.31.0) and sqlite3 (1.3.4 x86-mingw32): PASS

So I believe it would be either a jruby issue or a jdbc issue (I mean
the common jdbc subpart in sequel).

I can revert to older version of jruby to see if this is a regression
or not, but for the jdbc subpart, I'm not yet familiar enough with the
code).

-- 
Christian

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to