{"id":566,"date":"2014-06-23T21:21:17","date_gmt":"2014-06-23T21:21:17","guid":{"rendered":"http:\/\/tomvanmaanen.nl\/?p=566"},"modified":"2014-06-23T21:21:17","modified_gmt":"2014-06-23T21:21:17","slug":"different-codepages-in-sql-server","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=566","title":{"rendered":"Different codepages in SQL Server"},"content":{"rendered":"<p>It is possible in SQL Server to create columns in a table that have different codepage. This can be shown in the table below. That table has two attributes: char_unicode with a unicode codepage and char_latin that has a Latin codepage with West European characters only.<\/p>\n<p><a href=\"http:\/\/tomvanmaanen.nl\/wp-content\/uploads\/2014\/06\/codepage.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tomvanmaanen.nl\/wp-content\/uploads\/2014\/06\/codepage.jpg\" alt=\"codepage\" width=\"923\" height=\"217\" class=\"alignnone size-medium wp-image-567\" \/><\/a><\/p>\n<p>The char_latin cannot contain characters like \u0142, \u0130 or the \u03a6. Such characters are not part of the Latin codepage  as this codepage only contans characters that are in use in Western European languages. To store such characters, we might use the unicode codepage. Let us show how such characters are represented.<\/p>\n<p><a href=\"http:\/\/tomvanmaanen.nl\/wp-content\/uploads\/2014\/06\/Chars.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tomvanmaanen.nl\/wp-content\/uploads\/2014\/06\/Chars.jpg\" alt=\"Chars\" width=\"380\" height=\"220\" class=\"alignnone size-full wp-image-574\" \/><\/a>       <\/p>\n<p>The column char_unicode shows the characters  \u0130, \u03a6 , \u0418 and the \u0142. In the columns char_latin, these characters are inserted in the column but (obviously) couldn&#8217;t be represented. It is interesting to see what happens: the \u0130 is replaced by an I; a \u03a6 is replaced by the F, the \u0418 is replaced by an unknown and \u0142 is replaced by l.<br \/>\nThis allows an easy logical translation from, say \u0130stanbul into Istanbul. This is a very interesting property as we could easy store Polish, Turkish in local characters and store them in a logical understandable way if a Latin codepage is used. Nice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is possible in SQL Server to create columns in a table that have different codepage. This can be shown in the table below. That table has two attributes: char_unicode with a unicode codepage and char_latin that has a Latin codepage with West European characters only. The char_latin cannot contain characters like \u0142, \u0130 or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-566","post","type-post","status-publish","format-standard","hentry","category-nice-to-know"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=566"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/566\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}