I can't get the necessary characters.

RAKHIM 0 Reputation points
2023-09-02T20:36:58.1166667+00:00

Hello! In MS Access, I send a request to an API and receive data in Uzbek Latin script, including characters like G', Q, O'. Sh I need to convert them to Uzbek Cyrillic script, where these letters look like Ғ, Қ, Ў. Ш I've tried writing functions, but it didn't work. I read about ASCII, but there are no such letters in the ASCII table. How can I display them correctly in my field? I've been struggling with this for three days now! Thank you in advance for your help!

Access
Access
A family of Microsoft relational database management systems designed for ease of use.
336 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tanay Prasad 2,115 Reputation points
    2023-09-05T05:28:39.4666667+00:00

    Hi,

    You can convert characters from Uzbek Latin script to Uzbek Cyrillic script by using VBA functions. Since these specific characters do not exist in the ASCII character set, you'll need to create a custom function that performs the conversion.

    Here's a sample code for you-

    Function ConvertUzbekLatinToCyrillic(inputText As String) As String
        Dim latinChars As String
        Dim cyrillicChars As String
        Dim i As Integer
        
        ' Define the Uzbek Latin and Cyrillic characters you want to convert
        latinChars = "G'QO'Sh"
        cyrillicChars = "ҒҚЎЎ"
        
        ' Loop through the input text and replace Latin characters with Cyrillic characters
        For i = 1 To Len(inputText)
            Dim currentChar As String
            currentChar = Mid(inputText, i, 1)
            Dim charIndex As Integer
            charIndex = InStr(latinChars, currentChar)
            
            ' If the character is found in the Latin list, replace it with the corresponding Cyrillic character
            If charIndex > 0 Then
                currentChar = Mid(cyrillicChars, charIndex, 1)
            End If
            
            ' Append the character to the result
            ConvertUzbekLatinToCyrillic = ConvertUzbekLatinToCyrillic & currentChar
        Next i
    End Function
    
    

    Best Regards.

    0 comments No comments