How do i solve this issue "No data is available for encoding 1252" While Replacing the Ascii Value?

Hello

I want to change the Ascii Value of string becuase there’s non breaking space in one string.

Str1 :- “AJML TAX SERVICES PTY LIMITED”
Str2:-“AJML TAX SERVICES PTY LIMITED”

Str1 has non breaking space.

Str2 is Normal Text

when i compare this two string using changing the ascii value if Str1 Bot is throwing the Error.

PFA Screenshot

i have attached Screenshot of Ascii value of Both String.

Number 1 in pic is Extracted String Which I want to change the Ascii Value

Numner 2 is Actual Text.

Code: SS

Code Zip:
New folder.zip (119.2 KB)

nope. post is available

Hi @kishan.savaliya

If you want to compare two strings where one contains a non-breaking space (ASCII 160) and the other contains a regular space (ASCII 32), you can replace the non-breaking space in one of the strings with a regular space before performing the comparison.

Str1 = Str1.Replace(Chr(160), " ")

Not Working Same Error is Throwing

HI,

Can you try the following expression?

Final = Final.Replace(chrw(160),chr(32)).ToString.Trim

Regards,

1 Like

@kishan.savaliya

Try this

Str1 = Str1.Replace(ChrW(160), " ")

1 Like

Yes @Yoichi its working Fine Thanks For the Solutions.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.