Subject | Re: [Firebird-Java] Picture Servlet Problems possibly OT |
---|---|
Author | Blas Rodriguez Somoza |
Post date | 2003-06-05T22:53:40Z |
Hello William
At 05/06/2003 15:08 -0400, William L. Thomson Jr. wrote:
is the problem
if(result_set.next()) {
//ServletOutputStream sos = response.getOutputStream();
//sos.println(result_set.getString(1));
//sos.close();
PrintWriter print_writer = response.getWriter();
response.setContentType("image/jpeg");
response.setContentLength(result_set.getString(1).length());
print_writer.print(result_set.getString(1));
print_writer.close();
}
If you use getString() to get a value from a Blob column then the driver
must do a character conversion between the character set in which the bytes
are encoded and the one of the JVM.
Please get the blob with getBytes() and most probably your problem will
disappear.
I hope this helps.
Regards
Blas Rodriguez Somoza
At 05/06/2003 15:08 -0400, William L. Thomson Jr. wrote:
>On Thu, 2003-06-05 at 14:45, Blas Rodriguez Somoza wrote:It seems from your code that you get the Blob with a getString() and this
> >
> > I you are talking about images, then your BLOB must be sub_type 0
> and
> > not the driver nor the engine should do any character conversion.
> >
> > Please confirm the sub_type you are using.
>
>Yes, I am using sub_type 0. I also use sub_type 1 for Text. I do not
>have any problems with the text?
>
>I just came across a post on ib-support a while back. I then changed the
>default font of the my development linux server to the one of the
>production one. Which seems to not be defined? But ends up being
>ISO8859-1 or something like that. That resolved the problem in the
>development machine.
>
>I just changed the lc_ctype to ISO8859_1, and it appears to have
>resolved me problem as well on the win2k machines as well. I then
>reverted the linux development server back to UTF8, using the lc_ctype
>of ISO8859_1 and it works fine now as well.
>
>So I guess ASCII binary can easily convert to ISO8859-1 which can then
>be read on a system with a UTF8 default character set. For some reason
>only with binary sub_type 0 data is there conversion problems systems
>with default UTF8 character sets? Or something like that.
>
>Is that normal behavior?
is the problem
if(result_set.next()) {
//ServletOutputStream sos = response.getOutputStream();
//sos.println(result_set.getString(1));
//sos.close();
PrintWriter print_writer = response.getWriter();
response.setContentType("image/jpeg");
response.setContentLength(result_set.getString(1).length());
print_writer.print(result_set.getString(1));
print_writer.close();
}
If you use getString() to get a value from a Blob column then the driver
must do a character conversion between the character set in which the bytes
are encoded and the one of the JVM.
Please get the blob with getBytes() and most probably your problem will
disappear.
I hope this helps.
Regards
Blas Rodriguez Somoza