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.


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