Understanding Unicode

Understanding Unicode

VB4 introduces the use of double-byte characters. Most of this is transparentto the programmer and requires no special consideration. When calling APIfunctions or reading/writing to a file VB will handle the conversion foryou automatically. However, there may be times when you want to force a condition thatgoes against VB’s will. For example, you might want to write Unicode toa file, pass a Unicode string to a function, or receive a Unicode stringfrom a routine. In these cases you will have to use VB4’s new Byte declaration.A String Byte can vary between one or two bytes depending upon how it isused. A Byte-byte is exactly that: one byte. To convert a string variable into a byte array, use this code:

 Redim MyByteArray(0 to len(MyString$)-1) as ByteMyByteArray() = StrConv(MyString$, vbFromUniCode)

To convert a byte array to a string:

 MyString$ = StrConv(BA(), vbUniCode)

Due to a bug or design limitation, VB4 does not allow you to converta string to a binary array that is part of a Type structure. For example:

 TYPE MyByteType	Bytes( 0 to 255) as ByteEND TYPEDim MBA as MhByteTypeMBA.Bytes() = StrConv(MyString$, vbFromUniCode) 

returns an error. However,

 MyString$ = StrConv(MBA.Bytes() , vbUniCode) 

works as expected.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes