- Posts: 63
how to replace non ascii characters
- brian clark
- Topic Author
- Offline
- User
Less
More
6 months 3 weeks ago #3801
by brian clark
how to replace non ascii characters - Post(3801) was created by brian clark
Using regex
RegexReplace(File, '\xE2\x98\x8E', '') and the file are html files.
Am i doing this correctly?
RegexReplace(File, '\xE2\x98\x8E', '') and the file are html files.
Am i doing this correctly?
Please Log in or Create an account to join the conversation.
- brian clark
- Topic Author
- Offline
- User
Less
More
- Posts: 63
6 months 3 weeks ago #3802
by brian clark
Replied by brian clark on topic how to replace non ascii characters - Post(3802)
using System;
using System.Text.RegularExpressions;
public object DoWork()
{
int count = InValues.Length;
// Ensure at least one parameter is passed
if (count < 1)
{
string msg = ".NET Script Heater: minimum one input parameter expected!";
if (TestMode)
{
return msg;
}
else
{
throw new ArgumentException(msg);
}
}
// Get the input HTML content
string inputText = (string)InValues[0].GetValue();
// Remove all non-ASCII characters
string cleanText = Regex.Replace(inputText, @"[^\u0000-\u007F]", "");
// Return the cleaned text
return cleanText;
}
its past on from html / file to multiple regex then this script.
any pointers what i am doing wrong here... and where is the html input here (just so it sinks in)
using System.Text.RegularExpressions;
public object DoWork()
{
int count = InValues.Length;
// Ensure at least one parameter is passed
if (count < 1)
{
string msg = ".NET Script Heater: minimum one input parameter expected!";
if (TestMode)
{
return msg;
}
else
{
throw new ArgumentException(msg);
}
}
// Get the input HTML content
string inputText = (string)InValues[0].GetValue();
// Remove all non-ASCII characters
string cleanText = Regex.Replace(inputText, @"[^\u0000-\u007F]", "");
// Return the cleaned text
return cleanText;
}
its past on from html / file to multiple regex then this script.
any pointers what i am doing wrong here... and where is the html input here (just so it sinks in)
Please Log in or Create an account to join the conversation.
- brian clark
- Topic Author
- Offline
- User
Less
More
- Posts: 63
6 months 3 weeks ago #3803
by brian clark
Replied by brian clark on topic how to replace non ascii characters - Post(3803)
omg im a plonker. put the system part in the advanced section...
Cheers
it works so far so good.
Cheers
it works so far so good.
Please Log in or Create an account to join the conversation.
Time to create page: 0.255 seconds