From: Joseph M. <jo...@jm...> - 2014-11-25 23:15:47
|
I'm having a strange problem. When special symbols are stored in my database, if the record is edited, it gets written back to the database as a different symbol or several symbols. Here's an example: I have a Firebird application that uses C++ and IBObjects. If I enter or paste into a database field some text containing the Trademark symbol ™ (typed alt-0153. Bytes are e2 84 a2), it shows correctly in the database, on the screen, etc. Now, if I access the same database record using .NET, the Firebird .NET provider, and Entity Framework, and edit that record, even if I don't modify the field containing the trademark symbol, when I save the record, it writes the trademark symbol back as: â„¢ (bytes are c3 a2 e2 80 9e c2 a2). Here is the code that I'm using: PRODUCT p = db.PRODUCTS.FirstOrDefault<PRODUCT>(pp => pp.PRODBARCODE == ecp.PRODBARCODE && pp.STOREID == _storeid); p.PRODWEBDIRTY = "F"; db.Entry(p).State = EntityState.Modified; db.SaveChanges(); Note that PRODWEBDIRTY is not the field containing the trademark symbol. I guess it's just writing back the entire record to the database, but with the special characters converted. Why does it do this? How can I prevent it? -Joe |