CP-1252 in Golang
This article explains how to use the Code page 1252 (CP-1252) character in Golang. CP-1252 is single-byte character Latin Alphabet encoding. These characters are used by default in the legacy components of Microsoft Windows for English, Spanish, French, German/Scandinavian.
CP-1252 code example
euroSign := '\u20AC' // -> euro sign unicode
fmt.Printf("Euro sign print format: %c\n", euroSign)
valueOnly := fmt.Sprintf("%c", euroSign) // If you only want the resulting string.
fmt.Println("Euro sign value: ", valueOnly)
CP-1252 table
Unicode | Char | Unicode character description |
\u0021 | ! | Exclamation Mark |
\u0022 | “ | Quotation Mark |
\u0023 | # | Number sign |
\u0024 | $ | Dollar sign |
\u0025 | % | Percent sign |
\u0026 | & | Ampersand |
\u0027 | ‘ | Apostrophe |
\u0028 | ( | Left Parenthesis |
\u0029 | ) | Right Parenthesis |
\u002a | * | Asterisk |
\u002b | + | Plus sign |
\u002c | , | Comma |
\u002d | – | Hyphen-Minus |
\u002e | . | Full stop |
\u002f | / | Solidus |
\u0030 | 0 | Digit Zero |
\u0031 | 1 | Digit One |
\u0032 | 2 | Digit Two |
\u0033 | 3 | Digit Three |
\u0034 | 4 | Digit Four |
\u0035 | 5 | Digit Five |
\u0036 | 6 | Digit Six |
\u0037 | 7 | Digit Seven |
\u0038 | 8 | Digit Eight |
\u0039 | 9 | Digit Nine |
\u003a | : | Colon |
\u003b | ; | Semicolon |
\u003c | < | Less-than sign |
\u003d | = | Equals sign |
\u003e | > | Greater-than sign |
\u003f | ? | Question Mark |
\u0040 | @ | Commercial At |
\u0041 | A | Latin Capital Letter A |
\u0042 | B | Latin Capital Letter B |
\u0043 | C | Latin Capital Letter C |
\u0044 | D | Latin Capital Letter D |
\u0045 | E | Latin Capital Letter E |
\u0046 | F | Latin Capital Letter F |
\u0047 | G | Latin Capital Letter G |
\u0048 | H | Latin Capital Letter H |
\u0049 | I | Latin Capital Letter I |
\u004a | J | Latin Capital Letter J |
\u004b | K | Latin Capital Letter K |
\u004c | L | Latin Capital Letter L |
\u004d | M | Latin Capital Letter M |
\u004e | N | Latin Capital Letter N |
\u004f | O | Latin Capital Letter O |
\u0050 | P | Latin Capital Letter P |
\u0051 | Q | Latin Capital Letter Q |
\u0052 | R | Latin Capital Letter R |
\u0053 | S | Latin Capital Letter S |
\u0054 | T | Latin Capital Letter T |
\u0055 | U | Latin Capital Letter U |
\u0056 | V | Latin Capital Letter V |
\u0057 | W | Latin Capital Letter W |
\u0058 | X | Latin Capital Letter X |
\u0059 | Y | Latin Capital Letter Y |
\u005a | Z | Latin Capital Letter Z |
\u005b | [ | Left Square Bracket |
\u005c | \ | Reverse Solidus |
\u005d | ] | Right Square Bracket |
\u005e | ^ | Circumflex accent |
\u005f | _ | Low Line |
\u0060 | ` | Grave accent |
\u0061 | a | Latin Small Letter a |
\u0062 | b | Latin Small Letter b |
\u0063 | c | Latin Small Letter c |
\u0064 | d | Latin Small Letter d |
\u0065 | e | Latin Small Letter e |
\u0066 | f | Latin Small Letter f |
\u0067 | g | Latin Small Letter g |
\u0068 | h | Latin Small Letter h |
\u0069 | i | Latin Small Letter i |
\u006a | j | Latin Small Letter j |
\u006b | k | Latin Small Letter k |
\u006c | l | Latin Small Letter l |
\u006d | m | Latin Small Letter m |
\u006e | n | Latin Small Letter n |
\u006f | o | Latin Small Letter o |
\u0070 | p | Latin Small Letter p |
\u0071 | q | Latin Small Letter q |
\u0072 | r | Latin Small Letter r |
\u0073 | s | Latin Small Letter s |
\u0074 | t | Latin Small Letter t |
\u0075 | u | Latin Small Letter u |
\u0076 | v | Latin Small Letter v |
\u0077 | w | Latin Small Letter w |
\u0078 | x | Latin Small Letter x |
\u0079 | y | Latin Small Letter y |
\u007a | z | Latin Small Letter z |
\u007b | { | Left Curly Bracket |
\u007c | | | Vertical Line |
\u007d | } | Right Curly Bracket |
\u007e | ~ | Tilde |
\u007f | Delete | |
\u20ac | € | Euro sign |
\u201a | , | Single Low-9 Quotation Mark |
\u0192 | ƒ | Latin small letter f with hook |
\u201e | „ | Double low-9 Quotation Mark |
\u2026 | … | Horizontal Ellipsis |
\u2020 | † | Dagger |
\u2021 | ‡ | Double Dagger |
\u02c6 | ^ | Modifier letter circumflex accent |
\u0230 | ‰ | Per Mille Sign |
\u0160 | Š | Latin capital letter s with caron |
\u2039 | < | Single left-pointing angle quotation mark |
\u0152 | Œ | Latin capital ligature OE |
\u017d | Ž | Latin capital letter z with Caron |
\u2018 | ` | Left single quotation mark |
\u2019 | ’ | Right single quotation mark |
\u201c | “ | Left double quotation mark |
\u201d | ” | Right double quotation mark |
\u2022 | • | Bullet |
\u2013 | – | En dash |
\u2014 | — | Em dash |
\u02dc | ˜ | Small tilde |
\u2122 | ™ | Trade mark sign |
\u0161 | š | Latin small letter s with Caron |
\u203a | › | Single right-pointing angle quotation mark |
\u0153 | œ | Latin small ligature OE |
\u017e | ž | Latin small letter z with Caron |
\u0178 | Ÿ | Latin Capital letter Y with diaeresis |
\u00a0 | No-break space | |
\u00a1 | ¡ | Inverted exclamation mark |
\u00a2 | ¢ | Cent sign |
\u00a3 | £ | Pound sign |
\u00a4 | ¤ | Currency sign |
\u00a5 | ¥ | Yen sign |
\u00a6 | ¦ | Broken bar |
\u00a7 | § | Section sign |
\u00a8 | ¨ | Diaeresis |
\u00a9 | © | Copyright sign |
\u00aa | ª | Feminine ordinal indicator |
\u00ab | « | Left-pointing double angle quotation mark |
\u00ac | ¬ | Not sign |
\u00ad | Soft hypen | |
\u00ae | ® | Registered sign |
\u00af | ¯ | Macron |
\u00b0 | ° | Degree sign |
\u00b1 | ± | Plus-minus sign |
\u00b2 | ² | Superscript two |
\u00b3 | ³ | Superscript three |
\u00b4 | ´ | Acute accent |
\u00b5 | µ | Micro sign |
\u00b6 | ¶ | Pilcrow sign |
\u00b7 | · | Middle dot |
\u00b8 | ¸ | Cedilla |
\u00b9 | ¹ | Superscript one |
\u00ba | º | Masculine ordinal indicator |
\u00bb | » | Right-pointing double angle quotation mark |
\u00bc | ¼ | Vulgar fraction one quarter |
\u00bd | ½ | Vulgar fraction one half |
\u00be | ¾ | Vulgar fraction three quarter |
\u00bf | ¿ | Inverted question mark |
\u00c0 | À | Latin capital letter A with grave |
\u00c1 | Á | Latin capital letter A with acute |
\u00c2 | Â | Latin capital letter A with circumflex |
\u00c3 | Ã | Latin capital letter A with tilde |
\u00c4 | Ä | Latin capital letter A with diaeresis |
\u00c5 | Å | Latin capital letter A with ring above |
\u00c6 | Æ | Latin capital letter AE |
\u00c7 | Ç | Latin capital letter C with cedilla |
\u00c8 | È | Latin capital letter E with grave |
\u00c9 | É | Latin capital letter E with acute |
\u00ca | Ê | Latin capital letter E with circumflex |
\u00cb | Ë | Latin capital letter E with diaeresis |
\u00cc | Ì | Latin capital letter I with grave |
\u00cd | Í | Latin capital letter I with acute |
\u00ce | Î | Latin capital letter I with circumflex |
\u00cf | Ï | Latin capital letter I with diaeresis |
\u00d0 | Ð | Latin capital letter ETH |
\u00d1 | Ñ | Latin capital letter N with tilde |
\u00d2 | Ò | Latin capital letter O with grave |
\u00d3 | Ó | Latin capital letter O with acute |
\u00d4 | Ô | Latin capital letter O with circumflex |
\u00d5 | Õ | Latin capital letter O with tilde |
\u00d6 | Ö | Latin capital letter O with diaeresis |
\u00d7 | × | Multiplication sign |
\u00d8 | Ø | Latin capital letter O with stroke |
\u00d9 | Ù | Latin capital letter U with grave |
\u00da | Ú | Latin capital letter U with acute |
\u00db | Û | Latin capital letter U with circumflex |
\u00dc | Ü | Latin capital letter U with diaeresis |
\u00dd | Ý | Latin capital letter Y with acute |
\u00de | Þ | Latin capital letter thorn |
\u00df | ß | Latin small letter sharp s |
\u00e0 | à | Latin small letter a with grave |
\u00e1 | á | Latin small letter a with acute |
\u00e2 | â | Latin small letter a with circumflex |
\u00e3 | ã | Latin small letter a with tilde |
\u00e4 | ä | Latin small letter a with diaeresis |
\u00e5 | å | Latin small letter a with ring above |
\u00e6 | æ | Latin small letter AE |
\u00e7 | ç | Latin small letter c with cedilla |
\u00e8 | è | Latin small letter e with grave |
\u00e9 | é | Latin small letter e with acute |
\u00ea | ê | Latin small letter e with circumflex |
\u00eb | ë | Latin small letter e with diaeresis |
\u00ec | ì | Latin small letter i with grave |
\u00ed | í | Latin small letter i with acute |
\u00ee | î | Latin small letter i with circumflex |
\u00ef | ï | Latin small letter i with diaeresis |
\u00f0 | ð | Latin small letter ETH |
\u00f1 | ñ | Latin small letter n with tilde |
\u00f2 | ò | Latin small letter o with grave |
\u00f3 | ó | Latin small letter o with acute |
\u00f4 | ô | Latin small letter o with circumflex |
\u00f5 | õ | Latin small letter o with tilde |
\u00f6 | ö | Latin small letter o with diaeresis |
\u00f7 | ÷ | Division sign |
\u00f8 | ø | Latin small letter O with stroke |
\u00f9 | ù | Latin small letter u with grave |
\u00fa | ú | Latin small letter u with acute |
\u00fb | û | Latin small letter u with circumflex |
\u00fc | ü | Latin small letter u with diaeresis |
\u00fd | ý | Latin small letter y with acute |
\u00fe | þ | Latin small letter thorn |
\u00ff | ÿ | Latin small letter y with diaeresis |
Source code: GoDevTips repository
Follow us:
![](https://godevtips.com/wp-content/uploads/2020/01/facebook-icon-transparent-background-3-1-1024x1024.png)