Skip to Content.
Sympa Menu

freetds - [freetds] charset problem with Sybase on SunOS server and Ubuntu client

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frederick.Dubberspear AT sogetthis.com
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] charset problem with Sybase on SunOS server and Ubuntu client
  • Date: Wed, 5 Nov 2008 03:43:24 -0500

Hello,

We're using a simple PHP script to test a connection between an Ubuntu (Hardy
Heron) client and a SunOS server running Sybase 12.5. After stracing the PHP
script to find out why it wasn't even connecting in the first place, we got it
to connect, but now aren't able to run any queries, because of a charset issue
between the two machines. I'm not sure if the issue is on the client machine
or
the server. I'm leaning toward the server, but i wanted a second opinion on it
first. Here's the details:

In freetds.conf we have:

[$SERVER_NAME]
host = $IP_ADDRESS
port = $PORT
tds version = 5.0

Upon running the script, we get the errors:

Cannot find the requested character set in Syscharsets: name = 'UTF-8'.
No conversions will be done.
Changed data
Changed database context to 'master'.

We tried adding in freetds.conf:

client charset = UTF-8

and other charsets in freetds.conf, but nothing. Unsetting the LANG
environment
variable (falling back to C) just outputted the above error with
"ANSI_X3.4-1968" instead of UTF-8.

The client machine doesn't have a locales.dat file, but en_US.UTF-8 is in
/var/lib/locales/supported.d/local

We also tried adding this in locales.conf:

[default]
charset = UTF-8

and that was no help either. I'm attaching the freetds.log file below for
extra
clarification. If there's any other questions about the config, please let me
know.

TIA
14:38:06.326784 Starting log file for FreeTDS 0.63
on 2008-11-03 14:38:06 with debug level 99.
14:38:06.327155 names for ISO-8859-1: ISO-8859-1
14:38:06.327191 names for UTF-8: UTF-8
14:38:06.327225 names for UCS-2LE: UCS-2LE
14:38:06.327227 names for UCS-2BE: UCS-2BE
14:38:06.327290 iconv to convert client-side data to the "UTF-8" character set
14:38:06.327372 tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
14:38:06.327455 Connecting to $IP_ADDRESS port $PORT, TDS 5.0.
14:38:06.328340 Sending packet
0000 02 00 02 00 00 00 00 00-6c 61 6d 70 2e 72 69 63 |........ $HOST...|
0010 68 6c 61 6e 64 2e 6c 69-62 2e 73 63 2e 75 73 00 |$CLIENT_DOMAIN...|
0020 00 00 00 00 00 00 17 73-61 00 00 00 00 00 00 00 |.......$UN.......|
0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0040 00 00 00 00 00 02 68 74-6f 32 32 37 00 00 00 00 |......$PASSWD....|
0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0060 00 00 00 00 06 33 37 38-37 36 00 00 00 00 00 00 |.....378 76......|
0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0080 00 00 00 05 03 01 06 0a-09 01 00 00 00 00 00 00 |........ ........|
0090 00 00 00 00 50 48 50 20-35 00 00 00 00 00 00 00 |....PHP 5.......|
00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
00b0 00 00 05 68 70 5f 68 6f-72 69 7a 6f 6e 00 00 00 |...$SERVERNAME...|
00c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
00d0 00 0a 00 06 68 74 6f 32-32 37 00 00 00 00 00 00 |....$PASSWD......|
00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
01d0 00 08 05 00 00 00 44 42-2d 4c 69 62 72 61 72 79 |......DB -Library|
01e0 0a 05 00 00 00 00 0d 11-75 73 5f 65 6e 67 6c 69 |........ us_engli|
01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh...... ........|

14:38:06.328546 Sending packet
0000 02 01 00 61 00 00 00 00-00 00 00 00 00 00 0a 00 |...a.... ........|
0010 00 00 00 00 00 00 00 00-00 00 00 00 00 55 54 46 |........ .....UTF|
0020 2d 38 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |-8...... ........|
0030 00 00 00 00 00 00 00 00-00 00 00 05 01 35 31 32 |........ .....512|
0040 00 00 00 03 00 00 00 00-e2 16 00 01 09 00 00 06 |........ ........|
0050 6d 7f ff ff ff fe 02 09-00 00 00 00 0a 68 00 00 |m....... .....h..|
0060 00 - |.|

14:38:06.328617 tds_process_login_tokens()
14:38:06.334472 Received header
0000 04 01 01 42 00 00 00 00- |...B....|

14:38:06.334503 Received packet
0000 e5 64 00 69 09 00 00 02-0b 05 5a 5a 5a 5a 5a 00 |.d.i.... ..ZZZZZ.|
0010 01 00 49 00 43 61 6e 6e-6f 74 20 66 69 6e 64 20 |..I.Cann ot find |
0020 74 68 65 20 72 65 71 75-65 73 74 65 64 20 63 68 |the requ ested ch|
0030 61 72 61 63 74 65 72 20-73 65 74 20 69 6e 20 53 |aracter set in S|
0040 79 73 63 68 61 72 73 65-74 73 3a 20 20 6e 61 6d |yscharse ts: nam|
0050 65 20 3d 20 27 55 54 46-2d 38 27 2e 0a 06 53 59 |e = 'UTF -8'...SY|
0060 42 41 53 45 00 00 00 e5-38 00 6b 09 00 00 01 0a |BASE.... 8.k.....|
0070 05 5a 5a 5a 5a 5a 00 01-00 1d 00 4e 6f 20 63 6f |.ZZZZZ.. ...No co|
0080 6e 76 65 72 73 69 6f 6e-73 20 77 69 6c 6c 20 62 |nversion s will b|
0090 65 20 64 6f 6e 65 2e 0a-06 53 59 42 41 53 45 00 |e done.. .SYBASE.|
00a0 00 00 e3 0f 00 01 06 6d-61 73 74 65 72 06 6d 61 |.......m aster.ma|
00b0 73 74 65 72 e5 41 00 45-16 00 00 02 0a 05 5a 5a |ster.A.E ......ZZ|
00c0 5a 5a 5a 00 01 00 26 00-43 68 61 6e 67 65 64 20 |ZZZ...&. Changed |
00d0 64 61 74 61 62 61 73 65-20 63 6f 6e 74 65 78 74 |database context|
00e0 20 74 6f 20 27 6d 61 73-74 65 72 27 2e 0a 06 53 | to 'mas ter'...S|
00f0 59 42 41 53 45 00 00 00-e3 06 00 04 03 35 31 32 |YBASE... .....512|
0100 00 ad 14 00 05 05 00 00-00 0a 73 71 6c 20 73 65 |........ ..sql se|
0110 72 76 65 72 0c 05 00 00-e2 16 00 01 09 00 00 02 |rver.... ........|
0120 61 41 ff ff ff e6 02 09-00 00 00 00 02 00 00 00 |aA...... ........|
0130 00 fd 02 00 02 00 b3 00-00 00 |........ ..|

14:38:06.334595 looking for login token, got e5(EED)
14:38:06.334684 tds_process_default_tokens() marker is e5(EED)
14:38:06.334735 tds_get_string: reading 73 from wire to give 73 to client.
14:38:06.334764 tds_get_string: reading 6 from wire to give 6 to client.
14:38:06.334900 tds_client_msg: #20018: "General SQL Server error: Check
messages from the SQL Server.". Connection state is now 0.
14:38:06.334928 looking for login token, got e5(EED)
14:38:06.334951 tds_process_default_tokens() marker is e5(EED)
14:38:06.334976 tds_get_string: reading 29 from wire to give 29 to client.
14:38:06.335001 tds_get_string: reading 6 from wire to give 6 to client.
14:38:06.335042 looking for login token, got e3(ENVCHANGE)
14:38:06.335067 tds_process_default_tokens() marker is e3(ENVCHANGE)
14:38:06.335092 tds_get_string: reading 6 from wire to give 6 to client.
14:38:06.335117 tds_get_string: reading 6 from wire to give 6 to client.
14:38:06.335155 looking for login token, got e5(EED)
14:38:06.335177 tds_process_default_tokens() marker is e5(EED)
14:38:06.335201 tds_get_string: reading 38 from wire to give 38 to client.
14:38:06.335226 tds_get_string: reading 6 from wire to give 6 to client.
14:38:06.335280 looking for login token, got e3(ENVCHANGE)
14:38:06.335306 tds_process_default_tokens() marker is e3(ENVCHANGE)
14:38:06.335331 tds_get_string: reading 3 from wire to give 3 to client.
14:38:06.335358 looking for login token, got ad(LOGINACK)
14:38:06.335381 tds_get_string: reading 10 from wire to give 10 to client.
14:38:06.335406 looking for login token, got e2(CAPABILITY)
14:38:06.335428 tds_process_default_tokens() marker is e2(CAPABILITY)
14:38:06.335451 looking for login token, got fd(DONE)
14:38:06.335473 tds_process_default_tokens() marker is fd(DONE)
14:38:06.335496 tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
14:38:06.335519 tds_process_end() state set to TDS_IDLE
14:38:06.335541 leaving tds_process_login_tokens() returning 1
14:38:06.335590 tds_free_all_results()
14:38:06.335626 Sending packet
0000 0f 01 00 21 00 00 00 00-21 14 00 00 00 00 73 65 |...!.... !.....se|
0010 74 20 74 65 78 74 73 69-7a 65 20 36 34 35 31 32 |t textsi ze 64512|
0020 20 - | |

14:38:06.336285 Received header
0000 04 01 00 11 00 00 00 00- |........|

14:38:06.336308 Received packet
0000 fd 00 00 02 00 00 00 00-00 |........ .|

14:38:06.336322 processing result tokens. marker is fd(DONE)
14:38:06.336352 tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
14:38:06.336377 tds_process_end() state set to TDS_IDLE
14:38:06.336399 tds_process_result_tokens() state is COMPLETED
14:38:06.336677 tds_free_all_results()
14:38:06.336753 in dbfreebuf()



Archive powered by MHonArc 2.6.24.

Top of Page