If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > character set conversion

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-21-10, 12:33
jannovak jannovak is offline
Registered User
 
Join Date: Feb 2009
Location: Prague
Posts: 17
character set conversion

Hi, I'm confused. What is the special about character with ascii code 160?
I'll explain:

I've got ASE with default character set roman8. I log in from client using character set roman8. I enter following query:

Code:
1> create table #aaa (a varchar(10))
2> go
1> insert #aaa values (char(160))
2> go
(1 row affected)
1> select a,ascii(a) from #aaa
2> go
 a
 ---------- -----------
                    160

(1 row affected)

Which looks ok because ascii(160) is non-breakable space

If I log in from client using iso_1 character set I will get following:
Code:
1>create table #aaa (a varchar(10))
2> go
1> 
2> insert #aaa values (char(160))
3> go
(1 row affected)
1>
2>
3> select a,ascii(a) from #aaa
4> go
 a
 ---------- -----------
 ?                  160

WARNING!  Some character(s) could not be converted into client's character set.  Unconverted bytes were changed to question marks ('?').

(1 row affected)
But why? Iso_1 and roman8 both (according to what I investigated) contain 160 as non-breakable space...

Second point:

I'm definetly using roman8 for client and for ASE.
When I enter this:

Code:
1> insert #aaa values (char(161))
2> go
Then I get this:

Code:
1> select a,ascii(a) from #aaa
2> go
 a
 ---------- -----------
  ¡                  161

(2 rows affected)
Why? roman8 interpretation of ascii 161 is À
The character "¡" is 161 in iso_1 ...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On