{"id":12132,"date":"2022-10-05T23:31:11","date_gmt":"2022-10-05T14:31:11","guid":{"rendered":"https:\/\/prodskill.com\/?p=12132"},"modified":"2022-10-05T23:49:46","modified_gmt":"2022-10-05T14:49:46","slug":"sybase-ase-utf8-byte-char-length","status":"publish","type":"post","link":"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/","title":{"rendered":"A function to get the number of UTF-8 bytes and characters in a Sybase ASE string"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"540\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited.jpeg\" alt=\"Server: (\ucd9c\ucc98: \uc12c\uae30\ub294 \uc0ac\ub78c \uad6c\ub984 \uac1c\ubc1c - Pixabay\uc758 \ubb34\ub8cc \uc0ac\uc9c4)\" class=\"wp-image-12134\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited.jpeg 960w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited-300x169.jpeg 300w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited-768x432.jpeg 768w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited-18x10.jpeg 18w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited-24x14.jpeg 24w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited-36x20.jpeg 36w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2-edited-48x27.jpeg 48w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><figcaption>Server: (Source: <a href=\"https:\/\/pixabay.com\/ko\/photos\/%ec%84%ac%ea%b8%b0%eb%8a%94-%ec%82%ac%eb%9e%8c-%ea%b5%ac%eb%a6%84-%ea%b0%9c%eb%b0%9c-%ec%82%ac%ec%97%85-1235959\/\" target=\"_blank\" rel=\"noreferrer noopener\">Server Cloud Development - Free photo on Pixabay<\/a>)<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Let&#039;s take a look at the functions to find the number of UTF-8 bytes and characters in Sybase ASE DBMS. This function was created and used in a project that converts EUC-KSC, a Sybase ASE Non-Unicode encoding, to UTF-8, a Unicode encoding.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>* UTF-8 encoding Note: <a href=\"https:\/\/ko.wikipedia.org\/wiki\/UTF-8\" target=\"_blank\" rel=\"noreferrer noopener\">UTF-8 \u2013 Wikipedia, the everyone&#039;s encyclopedia (wikipedia.org)<\/a><\/p><\/blockquote>\n\n\n\n<p>When converting a column declared as varchar(10) in EUC-KSC to UTF-8, it is necessary to check the maximum number of bytes and characters.<\/p>\n\n\n\n<p>When converting to UTF-8, the maximum number of bytes and characters are necessary to determine how much to declare the maximum length of a string column. This function was used to calculate the maximum value by calculating the number of bytes and characters converted to UTF-8 encoding for the value stored in EUC-KSC encoding, which is not the declared length.<\/p>\n\n\n\n<p>The DBMS was tested on Sybase ASE v15.5. I haven&#039;t tested it on other versions, but I think it should work.<\/p>\n\n\n\n<p>Sybase ASE is very similar to MS-SQL, so you can use it without any modification in MS-SQL.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">&lt;&lt;Table of Contents&gt;&gt;<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/#1_UTF-8_%EB%B0%94%EC%9D%B4%ED%8A%B8%EC%88%98_%EA%B5%AC%ED%95%98%EA%B8%B0_%ED%95%A8%EC%88%98\" >1. UTF-8 byte count function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/#2_UTF-8_%EA%B8%80%EC%9E%90%EC%88%98_%EA%B5%AC%ED%95%98%EA%B8%B0_%ED%95%A8%EC%88%98\" >2. Function to find the number of UTF-8 characters<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_UTF-8_%EB%B0%94%EC%9D%B4%ED%8A%B8%EC%88%98_%EA%B5%AC%ED%95%98%EA%B8%B0_%ED%95%A8%EC%88%98\"><\/span>1. UTF-8 byte count function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"18,21,23,25\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-auto-translation=\"\">IF OBJECT_ID('dbo.GET_UTF8_BYTE') IS NOT NULL\n  DROP FUNCTION dbo.GET_UTF8_BYTE\nGO\n\nCREATE FUNCTION dbo.GET_UTF8_BYTE\n(\n    @IN_VAL VARCHAR(4000)\n)\nRETURNS INT\nAS\nBEGIN\n  DECLARE @CHK_LENGTH INT, @I INT, @CHK_BYTE INT, @BYTE_LEN INT, @UTF8_BYTE_LEN INT, @SUM_UTF8_BYTE_LEN INT\n\n  SELECT @I = 1, @CHK_LENGTH = LEN(@IN_VAL), @SUM_UTF8_BYTE_LEN = 0\n\n  WHILE @I &lt;= @CHK_LENGTH\n  BEGIN\n    SELECT @CHK_BYTE = ASCII(SUBSTRING(@IN_VAL, @I, 1))\n\n    IF @CHK_BYTE >= 128 -- ASCII \ucf54\ub4dc\uac00 alpha, numeric, control \ubb38\uc790 \ubc94\uc704\ub97c \ub118\ub294 \uacbd\uc6b0(2 Byte \ubb38\uc790\uc77c \uacbd\uc6b0)\n        SELECT @BYTE_LEN = 2, @UTF8_BYTE_LEN = 3\n    ELSE\n        SELECT @BYTE_LEN = 1, @UTF8_BYTE_LEN = 1\n\n    SELECT @SUM_UTF8_BYTE_LEN = @SUM_UTF8_BYTE_LEN + @UTF8_BYTE_LEN, @I = @I + @BYTE_LEN\n  END\n\n  RETURN @SUM_UTF8_BYTE_LEN\nEND\nGO<\/pre>\n\n\n\n<p>This code was written based on the following facts.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>If ASCII code of Non-Unicode 1 Byte is 128 or higher, 2-byte character (Korean, Chinese, Japanese, etc.)<\/li><li>Non-Unicode Hangul 1 character (2 bytes) is stored as 3 bytes in UTF-8 encoding<\/li><\/ul>\n\n\n\n<p>The explanation of the main code is as follows.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Line 18: Read the input string byte by byte.<\/li><li>Line 21: Set length of bytes to skip if ASCII code of bytes read is greater than or equal to 128, increase number of UTF-8 bytes by 3<\/li><li>Line 23: If ASCII code of bytes read is less than 128, set length of bytes to skip to 1, increment number of UTF-8 bytes by 1<\/li><li>Line 25: Accumulate the sum of UTF-8 bytes, increment the value of the condition variable @I in the WHILE loop by the length of bytes to skip<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_UTF-8_%EA%B8%80%EC%9E%90%EC%88%98_%EA%B5%AC%ED%95%98%EA%B8%B0_%ED%95%A8%EC%88%98\"><\/span>2. Function to find the number of UTF-8 characters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The above function can be modified as follows to obtain the number of characters rather than the number of UTF-8 bytes.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-auto-translation=\"\">IF OBJECT_ID('dbo.GET_CHAR_CNT') IS NOT NULL\n  DROP FUNCTION dbo.GET_CHAR_CNT\nGO\n\nCREATE FUNCTION dbo.GET_CHAR_CNT\n(\n    @IN_VAL VARCHAR(4000)\n)\nRETURNS INT\nAS\nBEGIN\n  DECLARE @CHK_LENGTH INT, @I INT, @CHK_BYTE INT, @BYTE_LEN INT, @UTF8_BYTE_LEN INT, @SUM_UTF8_BYTE_LEN INT, @SUM_CHAR_CNT INT\n\n  SELECT @I = 1, @CHK_LENGTH = LEN(@IN_VAL), @SUM_UTF8_BYTE_LEN = 0, @SUM_CHAR_CNT = 0\n\n  WHILE @I &lt;= @CHK_LENGTH\n  BEGIN\n    SELECT @CHK_BYTE = ASCII(SUBSTRING(@IN_VAL, @I, 1))\n\n    IF @CHK_BYTE >= 128 -- ASCII \ucf54\ub4dc\uac00 alpha, numeric, control \ubb38\uc790 \ubc94\uc704\ub97c \ub118\ub294 \uacbd\uc6b0(2 Byte \ubb38\uc790\uc77c \uacbd\uc6b0)\n        SELECT @BYTE_LEN = 2, @UTF8_BYTE_LEN = 3\n    ELSE\n        SELECT @BYTE_LEN = 1, @UTF8_BYTE_LEN = 1\n\n    SELECT @SUM_UTF8_BYTE_LEN = @SUM_UTF8_BYTE_LEN + @UTF8_BYTE_LEN, @I = @I + @BYTE_LEN\n    SELECT @SUM_CHAR_CNT = @SUM_CHAR_CNT + 1\n  END\n\n  --RETURN @SUM_UTF8_BYTE_LEN\n  RETURN @SUM_CHAR_CNT\nEND<\/pre>\n\n\n\n<p>The WHILE loop starting from line 16 ends with the @I variable as a condition. The @BYTE_LEN variable is set to 2 (double-byte character) or 1 (single-byte character) depending on the ASCII code of the byte read, and is added to @I in line 25. With this logic, the WHILE loop statement is repeatedly executed as many times as the number of characters.<\/p>\n\n\n\n<p>The reason why @SUM_CHAR_CNT is incremented by 1 in line 26 is that the number of repetitions is the number of characters.<\/p>","protected":false},"excerpt":{"rendered":"<p>Let&#039;s take a look at the functions to find the number of UTF-8 bytes and characters in Sybase ASE DBMS. This function was created and used in a project that converts from Sybase ASE Non-Unicode encoding, EUC-KSC, to Unicode encoding, UTF-8. * UTF-8 encoding Reference: UTF-8 \u2013 Wikipedia, the encyclopedia of all of us (wikipedia.org) EUC-KSC converts columns declared as varchar(10) to UTF-8...<\/p>","protected":false},"author":1,"featured_media":12133,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[268,269],"class_list":["post-12132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sybase-ase","tag-sybase-ase","tag-utf-8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218 - \uc0dd\uc0b0\uc131 Skill<\/title>\n<meta name=\"description\" content=\"Sybase ASE DBMS\uc5d0\uc11c UTF-8 \ubc14\uc774\ud2b8\uc218 \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf8\ub2e4. Non-Unicode \uc778\ucf54\ub529\uc778 EUC-KSC\uc5d0\uc11c UTF-8\ub85c \ubcc0\ud658\uc2dc \ucd5c\ub300 \ubc14\uc774\ud2b8 \uc218\ub97c \ud655\uc778\ud560 \ud544\uc694\uac00 \uc788\ub294\ub370, \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\ub294 \ud568\uc218\uac00 \uc5c6\uc5b4\uc11c \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc11c \uc0ac\uc6a9\ud588\ub2e4.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218 - \uc0dd\uc0b0\uc131 Skill\" \/>\n<meta property=\"og:description\" content=\"Sybase ASE DBMS\uc5d0\uc11c UTF-8 \ubc14\uc774\ud2b8\uc218 \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf8\ub2e4. Non-Unicode \uc778\ucf54\ub529\uc778 EUC-KSC\uc5d0\uc11c UTF-8\ub85c \ubcc0\ud658\uc2dc \ucd5c\ub300 \ubc14\uc774\ud2b8 \uc218\ub97c \ud655\uc778\ud560 \ud544\uc694\uac00 \uc788\ub294\ub370, \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\ub294 \ud568\uc218\uac00 \uc5c6\uc5b4\uc11c \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc11c \uc0ac\uc6a9\ud588\ub2e4.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/\" \/>\n<meta property=\"og:site_name\" content=\"\uc0dd\uc0b0\uc131 Skill\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-05T14:31:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-05T14:49:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"640\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Zerom\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Zerom\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/\"},\"author\":{\"name\":\"Zerom\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/#\\\/schema\\\/person\\\/bbad0870c78008c82edbe0960fe768bd\"},\"headline\":\"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218\",\"datePublished\":\"2022-10-05T14:31:11+00:00\",\"dateModified\":\"2022-10-05T14:49:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/\"},\"wordCount\":61,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/#\\\/schema\\\/person\\\/bbad0870c78008c82edbe0960fe768bd\"},\"image\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/image-2.jpeg\",\"keywords\":[\"Sybase ASE\",\"UTF-8\"],\"articleSection\":[\"Sybase ASE\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/\",\"url\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/\",\"name\":\"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218 - \uc0dd\uc0b0\uc131 Skill\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/image-2.jpeg\",\"datePublished\":\"2022-10-05T14:31:11+00:00\",\"dateModified\":\"2022-10-05T14:49:46+00:00\",\"description\":\"Sybase ASE DBMS\uc5d0\uc11c UTF-8 \ubc14\uc774\ud2b8\uc218 \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf8\ub2e4. Non-Unicode \uc778\ucf54\ub529\uc778 EUC-KSC\uc5d0\uc11c UTF-8\ub85c \ubcc0\ud658\uc2dc \ucd5c\ub300 \ubc14\uc774\ud2b8 \uc218\ub97c \ud655\uc778\ud560 \ud544\uc694\uac00 \uc788\ub294\ub370, \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\ub294 \ud568\uc218\uac00 \uc5c6\uc5b4\uc11c \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc11c \uc0ac\uc6a9\ud588\ub2e4.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#primaryimage\",\"url\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/image-2.jpeg\",\"contentUrl\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/image-2.jpeg\",\"width\":960,\"height\":640},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/sybase-ase-utf8-byte-char-length\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/#website\",\"url\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/\",\"name\":\"\uc0dd\uc0b0\uc131 Skill\",\"description\":\"Meta Thinking, Meta Working\",\"publisher\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/#\\\/schema\\\/person\\\/bbad0870c78008c82edbe0960fe768bd\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/prodskill.com\\\/ko\\\/#\\\/schema\\\/person\\\/bbad0870c78008c82edbe0960fe768bd\",\"name\":\"Zerom\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/productivity_clockgear.png\",\"url\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/productivity_clockgear.png\",\"contentUrl\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/productivity_clockgear.png\",\"width\":512,\"height\":512,\"caption\":\"Zerom\"},\"logo\":{\"@id\":\"https:\\\/\\\/prodskill.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/productivity_clockgear.png\"},\"url\":\"https:\\\/\\\/prodskill.com\\\/en\\\/author\\\/proda\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Function to calculate the number of UTF-8 bytes and characters in a Sybase ASE string - Productivity Skill","description":"Let&#039;s take a look at a function that calculates the number of UTF-8 bytes and characters in the Sybase ASE DBMS. When converting from the non-Unicode encoding EUC-KSC to UTF-8, I need to determine the maximum number of bytes. Since there&#039;s no built-in function, I created one myself.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/","og_locale":"en_US","og_type":"article","og_title":"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218 - \uc0dd\uc0b0\uc131 Skill","og_description":"Sybase ASE DBMS\uc5d0\uc11c UTF-8 \ubc14\uc774\ud2b8\uc218 \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf8\ub2e4. Non-Unicode \uc778\ucf54\ub529\uc778 EUC-KSC\uc5d0\uc11c UTF-8\ub85c \ubcc0\ud658\uc2dc \ucd5c\ub300 \ubc14\uc774\ud2b8 \uc218\ub97c \ud655\uc778\ud560 \ud544\uc694\uac00 \uc788\ub294\ub370, \uae30\ubcf8\uc73c\ub85c \uc81c\uacf5\ud558\ub294 \ud568\uc218\uac00 \uc5c6\uc5b4\uc11c \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc11c \uc0ac\uc6a9\ud588\ub2e4.","og_url":"https:\/\/prodskill.com\/en\/sybase-ase-utf8-byte-char-length\/","og_site_name":"\uc0dd\uc0b0\uc131 Skill","article_published_time":"2022-10-05T14:31:11+00:00","article_modified_time":"2022-10-05T14:49:46+00:00","og_image":[{"width":960,"height":640,"url":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2.jpeg","type":"image\/jpeg"}],"author":"Zerom","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Zerom","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#article","isPartOf":{"@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/"},"author":{"name":"Zerom","@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd"},"headline":"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218","datePublished":"2022-10-05T14:31:11+00:00","dateModified":"2022-10-05T14:49:46+00:00","mainEntityOfPage":{"@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/"},"wordCount":61,"commentCount":0,"publisher":{"@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd"},"image":{"@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#primaryimage"},"thumbnailUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2.jpeg","keywords":["Sybase ASE","UTF-8"],"articleSection":["Sybase ASE"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/","url":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/","name":"Function to calculate the number of UTF-8 bytes and characters in a Sybase ASE string - Productivity Skill","isPartOf":{"@id":"https:\/\/prodskill.com\/ko\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#primaryimage"},"image":{"@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#primaryimage"},"thumbnailUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2.jpeg","datePublished":"2022-10-05T14:31:11+00:00","dateModified":"2022-10-05T14:49:46+00:00","description":"Let&#039;s take a look at a function that calculates the number of UTF-8 bytes and characters in the Sybase ASE DBMS. When converting from the non-Unicode encoding EUC-KSC to UTF-8, I need to determine the maximum number of bytes. Since there&#039;s no built-in function, I created one myself.","breadcrumb":{"@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#primaryimage","url":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2.jpeg","contentUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/10\/image-2.jpeg","width":960,"height":640},{"@type":"BreadcrumbList","@id":"https:\/\/prodskill.com\/sybase-ase-utf8-byte-char-length\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prodskill.com\/ko\/"},{"@type":"ListItem","position":2,"name":"Sybase ASE \ubb38\uc790\uc5f4\uc758 UTF-8 \ubc14\uc774\ud2b8\uc218 , \uae00\uc790\uc218 \uad6c\ud558\ub294 \ud568\uc218"}]},{"@type":"WebSite","@id":"https:\/\/prodskill.com\/ko\/#website","url":"https:\/\/prodskill.com\/ko\/","name":"Productivity Skills","description":"Meta Thinking, Meta Working","publisher":{"@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prodskill.com\/ko\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd","name":"Zerom","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png","url":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png","contentUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png","width":512,"height":512,"caption":"Zerom"},"logo":{"@id":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png"},"url":"https:\/\/prodskill.com\/en\/author\/proda\/"}]}},"_links":{"self":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/posts\/12132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/comments?post=12132"}],"version-history":[{"count":0,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/posts\/12132\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/media\/12133"}],"wp:attachment":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/media?parent=12132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/categories?post=12132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/tags?post=12132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}