Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

replace NULL character

807589Oct 29 2008 — edited Oct 29 2008
Hi,

i have a Problem working with my Database. When retriving data from one database and writing it into another i get the following error:
PSQLException: invalid byte sequence for encoding "UTF8": 0x00 string

client and server and datasource are using en_US.UTF-8 so this should not be the problem!

i investigated the Problem. it seams like java allows Strings to contain a NULL character while jdbc doesnt allow it since is the server uses NULL terminated Strings.
http://archive.netbsd.se/?ml=pgsql-jdbc&a=2007-02&t=3176644

so my question is, how do i replace a NULL character in a string? or even delete the character from the string?


//edit: found out that the string looks like:
" \/\/$$" without the quotes but with the leading blank ;)

Edited by: soulspirit on Oct 29, 2008 4:48 AM

Edited by: soulspirit on Oct 29, 2008 4:48 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2008
Added on Oct 29 2008
2 comments
1,344 views