An alternative solution: text = "Tổng cộng" normalText = String.Join("", text.Normalize(System.Text.NormalizationForm.FormD).ToCharArray().Where(Function(c) System.Globalization.CharUnicodeInfo.GetUnicodeCategory(c) <> System.Globalization.UnicodeCategory.NonSpacingMark).ToArray) [image] [image] Answer from ptrobot on forum.uipath.com
🌐
UiPath Community
forum.uipath.com › help › studio
How to replace unicode in string - Studio - UiPath Community Forum
November 25, 2021 - Hi, i’m try to replace unicode in string like : Tổng cộng → Tong cong I’m try to use the way in this topic but result gonna be : T?ng c?ng Any idea for this, please help Thanks
🌐
UiPath Community
forum.uipath.com › help › robot
Replace text within string "" with \" \" - Robot - UiPath Community Forum
July 1, 2024 - Hi All, If I want to replace any string “” with " " what should be the expressions be like. For example, my original string is “Incident”. I want as "Incident"
Discussions

How to get ASCII/UTF8 value of a specific character in a string and replace it?
Hi Everyone! Been going round and round trying to figure out best way to approach this. I have a string that contains the contents of an email body. Sometimes the string may contain double quotes. It seems that what looks like a double quote to me, is actually something else. More on forum.uipath.com
🌐 forum.uipath.com
1
0
May 10, 2024
Removing Unicode characters
Good day all, I have the bellow data that I am trying to pass on the API field: It keeps on failing because it has some Unicode characters (\u0007), so the API keeps on failing because of that. Anyone who can please help on removing these using regex maybe not just this one but any unicode ... More on forum.uipath.com
🌐 forum.uipath.com
7
0
July 15, 2025
How to Replace Something From string
I have to remove @ from a string i used .replace but it is not working please find attached image More on forum.uipath.com
🌐 forum.uipath.com
4
0
March 15, 2022
Replace in String
Hello i’m trying to use replace activity i have this variable amount = " 1.256.563" so it have a space and dots “.” so i tryed this but just delete all content i’d like to understand how to use this and with out using Replace Activity (amount.Replace([“.”," "], “”) i don’t ... More on forum.uipath.com
🌐 forum.uipath.com
6
4
August 24, 2018
🌐
UiPath Community
forum.uipath.com › help › activities
Removing Unicode characters - Activities - UiPath Community Forum
July 15, 2025 - Good day all, I have the bellow data that I am trying to pass on the API field: It keeps on failing because it has some Unicode characters (\u0007), so the API keeps on failing because of that. Anyone who can please …
🌐
UiPath Community
forum.uipath.com › rpa discussions
How to Replace Something From string - RPA Discussions - UiPath Community Forum
March 15, 2022 - I have to remove @ from a string i used .replace but it is not working please find attached image
🌐
UiPath Community
forum.uipath.com › help
Replace in String - Help - UiPath Community Forum
August 24, 2018 - Hello i’m trying to use replace ... like to understand how to use this and with out using Replace Activity (amount.Replace([“.”," "], “”) i don’t ......
Find elsewhere
🌐
UiPath Community
forum.uipath.com › help › activities
How to replace a character of a string based on its position in the string - Activities - UiPath Community Forum
September 8, 2022 - Hi, I would like to do the following: I have a string variable called UserInput: “1234” I want to replace the second character of this string with the letter “p”. So then the new string should look like this: “1p34”. The way I am currently doing is: UserInput.Replace(UserInput(...
🌐
UiPath Community
forum.uipath.com › help › studio
Replace special characters form a String Variable - Studio - UiPath Community Forum
March 11, 2022 - Hi, I need to replace or delete all the special characters from a string variable. I was trying to use the .Replace method but it only replaces 1 character, I want it to replace as many special characters the variable h…
🌐
UiPath Community
forum.uipath.com › help
Replace unusual characters - Help - UiPath Community Forum
May 17, 2017 - I have a text string that when added into a Message Box appears with strange characters. The text is as follows: “Account: ‘180101’,’182401’” The result is as follows: Account: �180101�,�182401� I have used Text.Replace(“�”,“'”) and it is a bit of a hit and miss.
🌐
UiPath Community
forum.uipath.com › help
How to change Character encoding - Help - UiPath Community Forum
May 10, 2017 - Hi, I would like to type text as unicode encoding, but it seems that there is no setting to change character encoding. If you know how to change character encoding, would you tell me the way setting that? Best regards…
🌐
UiPath Community
forum.uipath.com › help
Find and replace character in string - Help - UiPath Community Forum
December 22, 2019 - Hi Everyone. I have extracted and got a string as below: value = -0.A382 I want to check the 3rd character of this string… if the 3rd character is “A”, then it will replace by “B”… output string : “-0.B382” I have tr…
🌐
UiPath
docs.uipath.com › activities › other › latest › workflow › replace
Activities - Replace Matching Patterns
Replacement with text - The replacement string. Pattern options - A bitwise combination of the enumeration values that specify options for matching. Result - A boolean variable that is set to true if the regular expression finds a match, and is set to false otherwise.
🌐
UiPath Community
forum.uipath.com › help
How do i remove special characters from a string? - Help - UiPath Community Forum
January 27, 2020 - hi all, i have seen it been done using REGEX but i would like to know how to do it without as mine doesn’t appear to be working Thank you
🌐
UiPath Community
forum.uipath.com › help › studio
Replace a character in the string - Studio - UiPath Community Forum
October 31, 2023 - Hi, I have a String with value = 1.241.82 I want to replace only the first period (.) in the string with comma (,). The first period can come anywhere in the string (like 12.41.82 or 124.1.82) The index of the first …
🌐
UiPath Community
forum.uipath.com › help › studio
Replace Special Character - Studio - UiPath Community Forum
March 17, 2022 - Hello all, i have a problem concerning a special character in a field I scrape from a webpage. The field looks like that: I only want the number, so I replace the other characters: Unfortunately, I cant assign the processed number to an INT32-Field, because the process says that its in the ...
Top answer
1 of 1
4

As for [System.Text.Encoding]::Default: That you're seeing UTF-8 as the value in UiPath implies that it is using PowerShell (Core) 7+ (pwsh.exe), the modern, install-on-demand, cross-platform edition built on .NET 5+, whereas Windows PowerShell (powershell.exe), the legacy, ships-with-Windows, Windows-only edition is built on .NET Framework.

  • PowerShell honors the system's active legacy OEM code page by default when interpreting output from external programs (such as Python scripts),[1] e.g. 850, as reported by chcp, and as reflected in [Console]::OutputEncoding from inside PowerShell.

    • That is, PowerShell interprets the byte stream received from external programs as text encoded according to [Console]::OutputEncoding, and decodes it that way, resulting in a Unicode in-memory string representation, given that PowerShell is built on .NET whose strings are composed of UTF-16 Unicode code units ([char]). If [Console]::OutputEncoding doesn't match the actual encoding that the external program uses, misinterpreted text can be the result, as in your case.[2]

      • Note: This interpretation only comes into play when PowerShell either captures or redirects output from an external program. Otherwise, the output prints directly to the console and the problem may not surface there. For example, running python script.py results in Cédric printing to the console, but python script.py | Write-Output - due to use of a pipeline - involves interpretation by PowerShell, and the encoding mismatch would result in CÚdric
    • A UTF-8 opt-in is available:

      • Execute the following in PowerShell, before calling the Python script (see this answer for background information):

        $OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
        
  • Python, by contrast, defaults to the system's active legacy ANSI code page (e.g. Windows-1252).[3]

    • A UTF-8 opt-in is available, either:

      • By defining environment variable PYTHONUTF8 with value 1: Before calling your Python script, execute $env:PYTHONUTF8=1 in PowerShell.

      • Or, in Python 3.7+, with explicit python CLI calls, by using the -X utf8 option (case matters).

Note:

  • Given the above - assuming that your Python script only ever outputs characters that are part of the Windows-1252 code page - the alternative is to leave Python at its defaults and (temporarily) set the console encoding to Windows-1252 instead of UTF-8:

    $OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding(1252)
    

There is an option to NOT require this configuration, by configuring Windows to use UTF-8 system-wide, as described in this answer, which sets both the active OEM and the active ANSI code page to 65001, i.e. UTF-8.

  • Caveat: This feature - still in beta as of Windows 11 22H2 - has far-reaching consequences:

    • It causes preexisting, BOM-less files encoded based on the culture-specific ANSI code page (e.g. Windows-1252) to be misinterpreted by default by Windows PowerShell, Python, and generally all non-Unicode Windows applications.

    • Note that .NET applications, including PowerShell (Core) 7+ (but not Windows PowerShell),[1] - have the inverse problem that they must deal with irrespective of this setting: Because they assume that a BOM-less file is UTF-8-encoded, they must specify the culture-specific legacy ANSI code page explicitly when reading such files.


[1] PowerShell-native commands and scripts, which run in-process, consistently communicate text via in-memory Unicode strings, due to using .NET strings, so no encoding problems can arise.
When it comes to reading files, Windows PowerShell defaults to the ANSI code page when reading source code and text files with Get-Content, whereas PowerShell (Core) 7+ now - commendably - consistently defaults to UTF-8, also with respect to what encoding is used to write files - see this answer for more information.

[2] Specifically, Python outputs byte 0xE9 meaning it to be character é, due to using Windows-1252 encoding. PowerShell, misinterprets this byte as referring to character Ú, because it decodes the byte as CP850, as reflected in [Console]::OutputEncoding. Compare [Text.Encoding]::GetEncoding(1252).GetString([byte[]] 0xE9) (-> é, whose Unicode code point is 0xE9 too, because Unicode is mostly a superset of Windows-1252) to [Text.Encoding]::GetEncoding(850).GetString([byte[]] 0xE9) (-> Ú, whose Unicode code point is 0xDA)

[3] This applies when its stdout / stderr streams are connected to something other than a console, such when their output is captured by PowerShell.