CryptoSys PKI Pro Manual

cnvUTF8BytesFrom8Bit

Convert a string of 8-bit single-byte-character-set (SBCS) characters into a UTF-8 encoded array of bytes for different code pages.

Syntax

[VBA]
Public Function cnvUTF8BytesFrom8Bit ( _
    szInput As String, _
    nOptions As Long _
) As Byte()

Parameters

szInput
String of 8-bit characters to be converted.
nOptions
Code page. Select one of:
PKI_CNV_CP_LATIN1 (0) ISO-8859-1 (Latin-1) (default)
PKI_CNV_CP_LATIN9 ISO-8859-15 (Latin-9) code page
PKI_CNV_CP_CP1252 Windows-1252 (CP1252) code page

Return Value

Byte(): UTF-8 encoded sequence of bytes.

Remarks

This is a more general version of cnvUTF8BytesFromLatin1 with options for different code pages. This solves the problem of dealing with characters not available in Latin-1, but available in other SBCS code pages. In particular the Euro Sign (U+20AC) encoded as 164 (0xA4) in Latin-9 (ISO-8859-15) and 128 (0x80) in Windows-1252.
[PREV: cnvToHex...]   [Contents]   [Index]   
   [NEXT: cnvUTF8BytesFromLatin1...]

Copyright © 2004-25 D.I. Management Services Pty Ltd. All rights reserved. Generated 2025-12-17T09:23:43Z.