views:

55

answers:

2

I get strings over an ODBC connection from a SQL Server 2005 which contain characters beginning with 'L\' followed by the character code. These characters are not displayable in Ruby/Rails but with other Applications which are using the same ODBC connection. I am using the ruby-odbc gem with utf-8. Umlaut characters are displayed correctly, but not these starting with 'L\'. Examples are 'L\264' for acent grave, 'L\262' is '³' and, 'L\263 is '²'.

My questions:

  • To which character set do they belong?
  • How can they be displayed in
    Ruby/Rails?
A: 

Looks like you've got some custom Unicode encoding. The "L" probably stands for either Left-to-Right or Latin. The numbers appear to be the Octal representation of the Unicode or Ansi character number. Weird.

This almost certainly has nothing to do with SQL Server. Probably an ODBC artifact woould be my guess.

RBarryYoung
A: 

The database uses Latin1 so it it probably Latin but superscript three is 179 in Latin/8859-1 and not 263. I am substituting the characters which can not be converted by iconv with equivalent characters from a convertible character set. This is sufficient because there a currently only three of these characters in the data.

RainerB