changing code page

  • Thread starter Thread starter Mrozik
  • Start date Start date
M

Mrozik

Hi!
i read and update data from database that have
ISO-8859-2 code page set
default my application (windows app) run in polish code page
(win1250)

how can i read data and show them to user in default windows code page
and send them back to db in iso-8859-2 code page?


Pawel
 
Mrozik said:
Hi!
i read and update data from database that have
ISO-8859-2 code page set
default my application (windows app) run in polish code page
(win1250)

how can i read data and show them to user in default windows code page
and send them back to db in iso-8859-2 code page?

Assuming you work with proper .NET (i.e. Unicode) strings in between,
there's nothing you have to do.

But if you're dealing with content at byte level, you have to reencode
all bytes using System.Text.Encoding.Convert().

Note that not all characters in Windows-1250 can be converted to
Latin-2 (the Euro symbol for example is missing), so this conversion is
not actually ideal -- you may lose user input.

Cheers,
 
Assuming you work with proper .NET (i.e. Unicode) strings in between,
there's nothing you have to do.

Yes i know that - the problem is, that database (Oracle)
contains data imported by other processes - I can't change
source and encoding of those data....
But if you're dealing with content at byte level, you have to reencode
all bytes using System.Text.Encoding.Convert().

Note that not all characters in Windows-1250 can be converted to
Latin-2 (the Euro symbol for example is missing), so this conversion is
not actually ideal -- you may lose user input.

thanks for your advice!
Pawel
 
Back
Top