Subject | RE: [Firebird-Java] Urgend character set problem |
---|---|
Author | Steffen Heil |
Post date | 2006-04-20T20:32:23Z |
Hello.
When I keep the datasource parameters at charset="ISO-8859-1" and
encoding="ISO8859_1" (which match the database) and have everything in
java
/ tomcat / html changed to UTF-8, then german umlauts (such as "��" - in
html ü ä) work as expected. However typographic quotations marks
(such as "��" - in html „ “) don't. Loading them from the
database
results in (int) string.charAt() == 132 / 147. However output to the html
document (utf-8) trashes them. Getting them from input from the browser, I
get (int) string.charAt() == 8220 / 8222. However storing them to the
database trashes them.
Setting charset="utf-8" and encoding="iso8859_1" trashes all special
characters.
Whenever I set encoding="unicode_fss" (with unchanged database) and have
charset="utf-8" or charset="iso-8859-1", I get
"org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544321. arithmetic
exception, numeric overflow, or string truncation" when loading data from
the database."
However, as time went on, I needed to restore a backup (loosing about 10
days' work, but restoring the whole productive system to iso-8859-1 and
therefor working more or less), so now it is not that urgend anymore. It
however still stalls any progress.
Second, you seem to have mistaken me for someone. I certainly do not have
your handy number.
I must agree that I am not sure, how it should work at all.
I always thought java would keep strings in memory always in the same
encoding (utf-8) and would only translate that to other charsets on input
/
output. Given that, it would be the driver to tell java upon string
creation
to do the translation. However this seems not to work.
My biggest problem is to not know where to look.
I would appeciate any help very much.
Best Regards,
Steffen
begin 666 smime.p7s
M,( &"2J&2(;W#0$'`J" ,( "`0$Q"S )!@4K#@,"&@4`,( &"2J&2(;W#0$'
M`0``H(((XC""`FHP@@'3H ,"`0("`P]Z%# -!@DJADB&]PT!`00%`#!B,0LP
M"08#500&$P):03$E,",&`U4$"A,<5&AA=W1E($-O;G-U;'1I;F<@*%!T>2D@
M3'1D+C$L,"H&`U4$`Q,C5&AA=W1E(%!E<G-O;F%L($9R965M86EL($ES<W5I
M;F<@0T$P'A<-,#4P.3$T,#DP-34W6A<-,#8P.3$T,#DP-34W6C!>,0TP"P8#
M500$$P1(96EL,1 P#@8#500J$P=3=&5F9F5N,14P$P8#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*H9(AO<-`P("
M`4 P!P8%*PX#`@<P#08(*H9(AO<-`P("`2@P!P8%*PX#`AHP"@8(*H9(AO<-
M`@4P> 8)*P8!! &"-Q $,6LP:3!B,0LP"08#500&$P):03$E,",&`U4$"A,<
M5&AA=W1E($-O;G-U;'1I;F<@*%!T>2D@3'1D+C$L,"H&`U4$`Q,C5&AA=W1E
M(%!E<G-O;F%L($9R965M86EL($ES<W5I;F<@0T$"`P]Z%#!Z!@LJADB&]PT!
M"1 ""S%KH&DP8C$+, D&`U4$!A,"6D$Q)3 C!@-5! H3'%1H87=T92!#;VYS
M=6QT:6YG("A0='DI($QT9"XQ+# J!@-5! ,3(U1H87=T92!097)S;VYA;"!&
M<F5E;6%I;"!)<W-U:6YG($-!`@,/>A0P#08)*H9(AO<-`0$!!0`$@8!!W&KH
M`ZN0R,I.&WI?9R3UT-VRL;?6F;\"TW"M<9!?F5Z#K7\K*EH825UBJQ#O1L.&
M#=!(>^I-;/Q2,YS4.7,V]8UO+FR+\;#6!9\(+'->C,\9MY9=$9QK9VFLW7N[
HHC1N)LZH22J22-1\&.#Y=PJT0;/8>X7>9=FI+HE (\F/7@``````````
`
end
When I keep the datasource parameters at charset="ISO-8859-1" and
encoding="ISO8859_1" (which match the database) and have everything in
java
/ tomcat / html changed to UTF-8, then german umlauts (such as "��" - in
html ü ä) work as expected. However typographic quotations marks
(such as "��" - in html „ “) don't. Loading them from the
database
results in (int) string.charAt() == 132 / 147. However output to the html
document (utf-8) trashes them. Getting them from input from the browser, I
get (int) string.charAt() == 8220 / 8222. However storing them to the
database trashes them.
Setting charset="utf-8" and encoding="iso8859_1" trashes all special
characters.
Whenever I set encoding="unicode_fss" (with unchanged database) and have
charset="utf-8" or charset="iso-8859-1", I get
"org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544321. arithmetic
exception, numeric overflow, or string truncation" when loading data from
the database."
> If that does not work, call me on my handy (I think you haveFirst thank you very much for that offer.
> it), or drop a private email with your phone number, so we
> can discuss this on the phone.
However, as time went on, I needed to restore a backup (loosing about 10
days' work, but restoring the whole productive system to iso-8859-1 and
therefor working more or less), so now it is not that urgend anymore. It
however still stalls any progress.
Second, you seem to have mistaken me for someone. I certainly do not have
your handy number.
I must agree that I am not sure, how it should work at all.
I always thought java would keep strings in memory always in the same
encoding (utf-8) and would only translate that to other charsets on input
/
output. Given that, it would be the driver to tell java upon string
creation
to do the translation. However this seems not to work.
My biggest problem is to not know where to look.
I would appeciate any help very much.
Best Regards,
Steffen
begin 666 smime.p7s
M,( &"2J&2(;W#0$'`J" ,( "`0$Q"S )!@4K#@,"&@4`,( &"2J&2(;W#0$'
M`0``H(((XC""`FHP@@'3H ,"`0("`P]Z%# -!@DJADB&]PT!`00%`#!B,0LP
M"08#500&$P):03$E,",&`U4$"A,<5&AA=W1E($-O;G-U;'1I;F<@*%!T>2D@
M3'1D+C$L,"H&`U4$`Q,C5&AA=W1E(%!E<G-O;F%L($9R965M86EL($ES<W5I
M;F<@0T$P'A<-,#4P.3$T,#DP-34W6A<-,#8P.3$T,#DP-34W6C!>,0TP"P8#
M500$$P1(96EL,1 P#@8#500J$P=3=&5F9F5N,14P$P8#500#$PQ3=&5F9F5N
M($AE:6PQ)# B!@DJADB&]PT!"0$6%6QI<W1S0'-T969F96XM:&5I;"YD93"!
MGS -!@DJADB&]PT!`0$%``.!C0`P@8D"@8$`NAP.,GIQZ(>]).H36NM*T'\&
MB2P,C(C/>37W'*JK3>F*$:N_"7&B`8;Y^K:F$E[4E[!R,->\!EK^2_3+<"SR
MW:F[TC(3D1[Y_' >KRHIS9^,(<>[,8]Z&FV<9DFZLH)^<I;FWU_FJO5P,J6H
MZ*J0_8.;?)"(;J@X(\P;K7ELAYL"`P$``:,R,# P( 8#51T1!!DP%X$5;&ES
M='- <W1E9F9E;BUH96EL+F1E, P&`U4=$P$!_P0", `P#08)*H9(AO<-`0$$
M!0`#@8$`9.YD\C#[/8UR*R%+"@2$=^B.9<>]"&F/_3<PN!XSY2U5#F41MJN9
M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