views:

40

answers:

2

We are doing a migration of our Sybase database that has a utf8 encoding to a server with iso 1 encoding. We are just using char and Varchar for our strings. Will doing backup and restore not truncate any strings? I was thinking that Char and Varchar are just single byte characters.

A: 

Any characters outside the ASCII range will likely get malformed/corrupted when you save UTF-8 characters as ISO-8859-1. UTF-8 stores characters outside ASCII range in multiple bytes. I would rather setup the target table to use UTF-8 encoding since that's the encoding of today and the future.

BalusC
Unfortunately I don't have a choice on the target encoding :(
Alan
A: 

You CANNOT migrate Unicode data to ISO-8859 data. 99.5% of Unicode characters cannot be represented in ISO-8859. If you happen to only have Latin-1 characters in your data, then it's a no-op; otherwise it is undefined whether your migration tool will choke, whether it will report success but corrupt your data, whether it will preserve what's possible and insert wrong characters for impossible-to-represent characters, whether it will omit some characters...

Remember that Unicode contains ten thousands of characters, and ISO only 256. What you are trying to do can have many outcomes, but "everything works correctly" is not one of them.

Kilian Foth