UNICODE Characters
They soon realised that the 255 ASCII values were not sufficient for the number of characters that computers needed to work with.
As a result the Unicode standard was created using values 0-65,535
The UNICODE character set is a universal standard across all systems.
UTF8
UTF16
ASCW - Returns the Unicode number for the first character in a text string.
CHRW - Returns the character with the corresponding Unicode number.
| space | %20 | : | %3A | T | %54 | n | %6E |
| ! | %21 | ; | %3B | U | %55 | o | %6F |
| " | %22 | < | %3C | V | %56 | p | %70 |
| # | %23 | = | %3D | W | %57 | q | %71 |
| $ | %24 | > | %3E | X | %58 | r | %72 |
| % | %25 | ? | %3F | Y | %59 | s | %73 |
| & | %26 | @ | %40 | Z | %5A | t | %74 |
| ' | %27 | A | %41 | [ | %5B | u | %75 |
| ( | %28 | B | %42 | \ | %5C | v | %76 |
| ) | %29 | C | %43 | ] | %5D | w | %77 |
| * | %2A | D | %44 | ^ | %5E | x | %78 |
| + | %2B | E | %45 | _ | %5F | y | %79 |
| , | %2C | F | %46 | ` | %60 | z | %80 |
| - | %2D | G | %47 | a | %61 | { | %81 |
| . | %2E | H | %48 | b | %62 | | | %82 |
| / | %2F | I | %49 | c | %63 | } | %83 |
| 0 | %30 | J | %4A | d | %64 | ~ | %84 |
| 1 | %31 | K | %4B | e | %65 | ||
| 2 | %32 | L | %4C | f | %66 | ||
| 3 | %33 | M | %4D | g | %67 | ||
| 4 | %34 | N | %4E | h | %68 | ||
| 5 | %35 | O | %4F | i | %69 | ||
| 6 | %36 | P | %50 | j | %6A | ||
| 7 | %37 | Q | %51 | k | %6B | ||
| 8 | %38 | R | %52 | l | %6C | ||
| 9 | %39 | S | %53 | m | %6D |
ASCW Bug
This returns the bit pattern for unsigned 16-bit integers.
VBA uses signed 16-bit integers so after 32767 this function will return negative numbers.
Use the following function instead
Public Function ASCW_2(ByVal sChar As String) As Integer
ASCW_2 = (ASCW(sChar) And &HFFF&)
End Function
© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited TopPrevNext