Re: Obtain Unicode value from Character Code?

From: Craig Wagner (craig_d_wagner_at_hotmail.com)
Date: 09/10/04


Date: Fri, 10 Sep 2004 08:27:02 -0700

Jon Skeet [C# MVP] <skeet@pobox.com> wrote:

>Craig Wagner <craig_d_wagner@hotmail.com> wrote:
>> I have a situation where I have a series of character codes stored in the
>> database. In some cases they are the ASCII value of the character, in other
>> cases they are the > 127 character code value that you use in combination with
>> the ALT key to enter special characters into a document (e.g. ALT+0147 and
>> ALT+0148 get you 'smart quotes').
>
><snip>
>
>> Any suggestions?
>
>I *think* you're after Encoding.Default.
>
>However, the database really ought to be able to know how it's stored
>them and give you the text in Unicode. What's the type of the column,
>what's the database in question, and how are you retrieving the
>database?

The database has stored the value as an integer. The database isn't storing the
character, it's storing the character code (i.e. it's not storing the smart
quote, it's storing 147 as an integer).

The database is SQL Server 2000 and my C# code is calling a stored proc that is
used to populate a DataTable.

---
Craig Wagner, craig.wagner(at)comcast.net
Portland, OR
"Don't ban high-performance vehicles, ban low-performance drivers!"


Relevant Pages

  • Re: Obtain Unicode value from Character Code?
    ... >> The database has stored the value as an integer. ... The database isn't storing the ... >> character, it's storing the character code (i.e. it's not storing the smart ... "Don't ban high-performance vehicles, ban low-performance drivers!" ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Ideas on storing and retriving files in a Windows Application
    ... files etc. 2) Because it is stored in a relational database, ... blobs takes some minor modifications other than just using SELECT blah FROM ... horror stories of people who started storing BLOB data in a db only to have ... > will open the appropiatte application to display the file and 2. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Number + 1
    ... Using the same number in a variety of databases may be a reason for storing ... incremented portion and the extended portion. ... The value for dmrdate is assigned automatically as today's date and time, ... My experience not only with my database but with other customers & ...
    (microsoft.public.access.gettingstarted)
  • Re: Image ctl causes bloat when using text field to store path/fil
    ... Are you storing the image in the database? ... it in your database or embedding it in the report and/or form. ... got the same bloating problem in a report containing the Image control. ... Compact on Close will attempt to do so while the database is use... ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Concatenate and Null Values -- Features
    ... I have to say it's hard for me to see how a sequence number such as I have ... I should probably mention that this database is unlikely to generate more ... I wonder if storing 07-01 (probably without the dash, ... I think I know what you're saying about learning by teaching. ...
    (microsoft.public.access.reports)