Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
Hello Please excuse me that I'm not using russian. My russian is very bad. I can read what is written but it's really hard for me to write in your language. I have the following problem: I'm using ASE 15.0 In my database I have more that 1000 java class, many sqlj procedures and functions. In some of them I have to send warning messages to my clients. To do that I'm using following code: throw new Exception("текст"); or PreparedStatement pstmt = con.prepareStatement("raiserror 99999 'текст' "); pstmt.execute(); The message is sended to the client but the text is incorrect. I getting incorrect text no matter from where I execute my sqlj procedure (Iteractive SQL, MFC program). Server's default character set is Cp1251. The unicode conversion between Java and ASE is enabled. Even if it is not enabled the text is incorrect. If my message is from 3 symbols I get 6 symbols as a result. I think that the server is making some conversion but it is not doing it right. Have ever faced with this problem? Is there an other way to send warning message to my client application ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 16:22 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
Переведу что ли ... rulermHello У меня следующая проблема. Я использую ASE 15.0. В моей базе данных у меня более 1000 Java-классов, много SQLJ-процедур и функций. В некоторых из них мне приходится посылать предупреждения клиентам. Я это делаю так: Код: plaintext 1. или Код: plaintext 1. 2. Сообщение посылается клиенту, но текст сообщения неправильный. При этом не имеет значения откуда я выполняю SQLJ-процедуру (Iteractive SQL, MFC program), я получаю сообщение неправильно. На сервере default character set - Cp1251. Unicode conversion между Java и ASE включён. Но даже если его отключить, текст все равно неверный. Если напр. мое сообщение из трех символов, я получаю на клиенте 6 символов. Я думаю, что сервет выполняет какие-то преобразования, но делает это неправильно. Вы сталкивались с такой проблемой когда-нибудь ? Есть ли какой-то другой путь послать сообщение клиенту ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 16:51 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
Спосибо MasterZiv :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 17:05 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
rulermIf my message is from 3 symbols I get 6 symbols as a result.most likely, your client receive string in UTF-16. ...or client (I suspect it is written on Java itself) does it's own conversion of string to UTF-16 but visual control is not ready to handle it. Try to connect to DB from the most simplistic tool you can find (I would go with my own ODBC client for example) and see that exactly comes to your application from driver. At least you would be able to tell is incorrect string conversion happens in the db->driver or driver->application or is it pure application problem. Your turn MasterZiv :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 17:39 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
My client is MFC program. I'm using ODBC. When I execute my sqlj procedure within isql or Interactive SQL I get the same rubbish. In this case the only driver involved is the native jdbc driver. In the ASE 15.0 documentation is written that the conversion between Unicode and the default character set (in my case Cp1251) inside the server is made automatically. And It's true when I'm inserting some text in a table using PreparedStatement from sqlj procedure as follows: PreparedStatement pstmt = con.prepareStatement("insert into tbl(text) values(?)"); pstmt.setString(1,"Стоян"); pstmt.executeUpdate(); the inserted text is correct. It is interesting that when I'm using PreparedStatement pstmt = con.prepareStatement("insert into tbl(text) values('Стоян')"); pstmt.executeUpdate(); Rubbish is inserted. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 18:09 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
Execute once and look at output: select * from syscharsets where id=190 go sp_configure "enable unicode conversion" go Execute in "good" and "bad" connection and compare results: select @@client_csid,@@char_convert go ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 18:44 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
select * from syscharsets where id=190 go nothing returned. ----------------------- sp_configure "enable unicode conversion" go Parameter Name: enable unicode conversions Default: 1 Memory Used: 0 Config Value: 1 Run Value:1 Unit: switch Type: dynamic ---------------------------------- select @@client_csid,@@char_convert go @@client_csid = 53 @@char_convert = 0 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 18:57 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
White Owl пишет: > Your turn MasterZiv :) I haven't even a foggiest idea. Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 19:07 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
You do not have utf8 installed on this server: charset.exe -Usa -P... -Sserver_name binary.srt utf8 Your client charset is cp1251 and server does not do any conversion inside it. You can try to connect to server with client charset = utf8 and check results. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 19:25 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
Thank about the advice. Tommorow at work I'll try it and I'll tell the results :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 20:13 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
just meYou do not have utf8 installed on this server: charset.exe -Usa -P... -Sserver_name binary.srt utf8 Your client charset is cp1251 and server does not do any conversion inside it. You can try to connect to server with client charset = utf8 and check results. First step is not mandatory. You can try to change only client charset to utf8. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 20:55 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
It's a little bit complicated. My client application is now working with ASA 9.0. I have to make it to work also with ASE 15.0 If I change the client's character set I'll have a problem with my ASA 9.0. And my client application is MFC program. I don't know if I can change the character set. Before a couple of days I set the jdbc driver's option CHARSET = "utf8" and there was no effect. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 23:07 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
Stoyan MinchevBefore a couple of days I set the jdbc driver's option CHARSET = "utf8" and there was no effect.Remove quotes around charset name. Define it simply: UID=...;PWD=...;CHARSET=utf8 ;someotherkey=... and that should do the trick ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.08.2007, 23:15 |
|
||
|
Unicode conversion problem
|
|||
|---|---|---|---|
|
#18+
I didn't write it correctly props.put("user", ase_db_conf.getUser()); props.put("password", ase_db_conf.getPass()); props.put("CHARSET","utf-8"); this is the way i tried to change the driver's charset. As I said before I can't change the client's character set. I installed utf8 and there is no possitive effect. But why utf8? Java is using utf16 isn't it? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.08.2007, 10:43 |
|
||
|
|

start [/forum/topic.php?fid=55&msg=34702787&tid=2011981]: |
0ms |
get settings: |
5ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
43ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
45ms |
get tp. blocked users: |
2ms |
| others: | 216ms |
| total: | 347ms |

| 0 / 0 |
