Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal static string FixUnicodeChars(string text)
- {
- const string defHyphen = "-"; // - Hyphen-minus (\u002D) (default ansii)
- const string defColon = ":";
- // Hyphens
- text = text.Replace("\u2043", defHyphen); // ⁃ Hyphen bullet (\u2043)
- text = text.Replace("\u2010", defHyphen); // ‐ Hyphen (\u2010)
- text = text.Replace("\u2012", defHyphen); // ‒ Figure dash (\u2012)
- text = text.Replace("\u2013", defHyphen); // – En dash (\u2013)
- text = text.Replace("\u2014", defHyphen); // — Em dash (\u2014)
- text = text.Replace("\u2015", defHyphen); // ― Horizontal bar (\u2015)
- // Colons:
- text = text.Replace("\u02F8", defColon); // ˸ \u02F8
- text = text.Replace("\u003A", defColon); // : \u003A
- return text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement