You can also get the client character set id from the output of DBCC PSS( suid, spid)
[see DBCC pss - Enterprise Information Management - SCN Wiki ]
The field "pclient_csid" contains the id of the client's character set.
Examples:
bret-sun2% isql -Usa -P -Jutf8
1> select @@spid
2> go
------
15
(1 row affected)
1> set switch on 3604
2> go
Switch 3604 ('print_output_to_client') is turned on.
All supplied switches are successfully turned on.
1> dbcc pss(1,15)
2> go | grep csid
plangid=0 pclient_csid=190 pnextcid=1
1> exit
bret-sun2% isql -Usa -P -Jiso_1
1> select @@spid
2> go
------
17
(1 row affected)
1> set switch on 3604
2> go
Switch 3604 ('print_output_to_client') is turned on.
All supplied switches are successfully turned on.
1> dbcc pss(1,17)
2> go | grep csid
plangid=0 pclient_csid=1 pnextcid=1
There is an open feature request CR 700602 to enhance the pssinfo() built-in function to output additional fields, I've added pclient_csid to the list of requested fields.
-bret