My imported text contains several Unicode escape sequences  \u0092 \u0093 \u0094 \u0095 \u0096  Sample text:   string str = " Canadian Equity Funds may also invest in or use derivative instruments as described in “Investment Strategies – Use of Derivative Instruments" ";   Example c# text:    may also invest in or use derivative instruments as described in \u0093Investment Strategies \u0096 Use of Derivative Instruments\u0094."   I tried using this  Regex rx = new Regex(@"\\[uU]([0-9A-F]{4})"); var newString = rx.Replace(input, match =&gt;  ((char)Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString());   I get exactly  the same string.  I tried about every way I could to convert these to actual text, but to no avail. What am I supposed to do with them?
22804
Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string.   Example:     "The following is the top half of an integral character in Unicode '\u2320', and this is the lower half '\U2321'."
72890
Is there any use for the unescaped ^ in (La)TeX, when not in math mode? If not, I couldn't see why it's necessary to escape it.
77376
var i : integer;  i := 1234567;   Given the above, I want the string "1,234,567" as output (assuming UK locale). IntToStr just gives me "1234567". I'm sure there's a one-liner for this, but I can't find it...
5878
I have a Unicode string in Python, and I would like to remove all the accents (diacritics). I found on the web an elegant way to do this (in Java):  convert the Unicode string to its long normalized form (with a separate character for letters and diacritics) remove all the characters whose Unicode type is &quot;diacritic&quot;.  Do I need to install a library such as pyICU or is this possible with just the Python standard library?  And what about python 3? Important note: I would like to avoid code with an explicit mapping from accented characters to their non-accented counterpart.
38100
I have this regex I built and tested in regex buddy.  "_ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}"   When I use this in .Net C#   I receive the exception  "parsing \"_ [ 0-9]{10}+ +[ 0-9]{10}+  +[ 0-9]{6}+  [ 0-9]{2}\" - Nested quantifier +."   What does this error mean? Apparently .net doesn't like the expression.  Here is the regex buddy so u can understand my intention with the regex...  _ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}  Match the characters "_ " literally «_ » Match a single character present in the list below «[ 0-9]{10}+»    Exactly 10 times «{10}+»    The character " " « »    A character in the range between "0" and "9" «0-9» Match the character " " literally « {1}+»    Exactly 1 times «{1}+» Match a single character present in the list below «[ 0-9]{10}+»    Exactly 10 times «{10}+»    The character " " « »    A character in the range between "0" and "9" «0-9» Match the character " " literally « {2}+»    Exactly 2 times «{2}+» Match a single character present in the list below «[ 0-9]{6}+»    Exactly 6 times «{6}+»    The character " " « »    A character in the range between "0" and "9" «0-9» Match the character " " literally « {2}»    Exactly 2 times «{2}» Match a single character present in the list below «[ 0-9]{2}»    Exactly 2 times «{2}»    The character " " « »    A character in the range between "0" and "9" «0-9»   In short...  What is a Nested quantifier?
25338
I need to search a string and replace all occurrences of %FirstName% and %PolicyAmount% with a value pulled from a database. The problem is the capitalization of FirstName varies. That prevents me from using the String.Replace() method. I've seen web pages on the subject that suggest  Regex.Replace(strInput, strToken, strReplaceWith, RegexOptions.IgnoreCase);   However for some reason when I try and replace %PolicyAmount% with $0, the replacement never takes place. I assume that it has something to do with the dollar sign being a reserved character in regex.   Is there another method I can use that doesn't involve sanitizing the input to deal with regex special characters?
98690
Let's say I open a webpage with some Unicode characters, say, Cyrillic, in the address like this:        When I try to copy it from the address bar somewhere else, it becomes unreadable rubbish:        I guess this is for compatibility. However for readability I want to copy it straight away with proper Unicode characters.  What and how should I tweak to make that possible?  Edit: The answers are good, but they are hacky. Are there any settings in about:config?
8869
I would like to construct what Unicode calls "white curly brackets" that are in addition scalable. They look like ⦃ (≈{|) and ⦄ (≈|}) and have Unicode codepoints U+2983 and U+2984.  unicode-math has them as \lBrace and \rBrace, but (1) I don't presently use XeTeX or LuaTeX and (2) their design (shown in  on pages 3-4) is not to my liking: the brace part is too fat for my taste, and I would like the vertical bar to not leave any protrusions. I am trying to have them visually match the parentheses \llparenthesis, \rrparenthesis, \llbracket, and \rrbracket from stmaryrd.  Right now I am using a makeshift definition, which is sufficient for now, but the symbols don't scale (in general or with \left/\right). Here is sample code:  \documentclass{article} \usepackage{amsmath} \usepackage[only,llbracket,rrbracket,llparenthesis,rrparenthesis]{stmaryrd} % for comparison with 4 similar parenthesis symbols \usepackage{accsupp} % for ensuring the right Unicode codepoint upon pasting  \newcommand*{\llbrace}{%   \BeginAccSupp{method=hex,unicode,ActualText=2983}%     \textnormal{\usefont{OMS}{lmr}{m}{n}\char102}%     \mathchoice{\mkern-4.05mu}{\mkern-4.05mu}{\mkern-4.3mu}{\mkern-4.8mu}%     \textnormal{\usefont{OMS}{lmr}{m}{n}\char106}%   \EndAccSupp{}% } \newcommand*{\rrbrace}{%   \BeginAccSupp{method=hex,unicode,ActualText=2984}%     \textnormal{\usefont{OMS}{lmr}{m}{n}\char106}%     \mathchoice{\mkern-4.05mu}{\mkern-4.05mu}{\mkern-4.3mu}{\mkern-4.8mu}%     \textnormal{\usefont{OMS}{lmr}{m}{n}\char103}%   \EndAccSupp{}% }   \begin{document}  \noindent ok: \(\displaystyle\llbrace abc \rrbrace\) \(\textstyle\llbrace abc \rrbrace\) \(\scriptstyle\llbrace abc \rrbrace\) \(\scriptscriptstyle\llbrace abc \rrbrace\)  \noindent ok: \(\displaystyle \llbrace \frac{a}{b} \rrbrace\) \(\textstyle\llbrace \frac{a}{b} \rrbrace\) \(\scriptstyle\llbrace \frac{a}{b} \rrbrace\) \(\scriptscriptstyle\llbrace \frac{a}{b} \rrbrace\)  \noindent incorrectly scaled (\verb|\scriptsize|): {\scriptsize\(\llbrace abc \rrbrace\)} (large magnification required)  \noindent incorrectly scaled (\verb|\tiny|): {\tiny\(\llbrace abc \rrbrace\)}  \noindent \verb|\left| and \verb|\right| not possible before \verb|\llbrace| and \verb|\rrbrace|: \\ \indent \(\llbrace \left\llbracket\left\{\left[(a) \cdot bc^{2^3}\right]^4\right\}^5\right\rrbracket \rrbrace\) % Note: This is also not possible with \llparenthesis and \rrparenthesis from stmaryrd.  \noindent for comparison: \(\llparenthesis x \rrparenthesis, \llbracket x \rrbracket, \llbrace x \rrbrace; (x), [x], \{x\}\)  \end{document}   Lines 1 and 2 look just right with the present setup. Lines 3 and 4 demonstrate that my definitions don't scale. Lines 5a/b gives an example of where I would like to be able to use \left and \right. Line 6 juxtaposes different types of parentheses for visual comparison.  Is there an easy way to scale the glyphs I have constructed myself? Or is designing new glyphs the only way? While the vertical part of my glyphs doesn't leave any protrusions, the "brace part being too fat" part of my problem isn't being addressed by my code. With this in mind: I recognize that it might not be that easy to make the brace part of the glyph thinner (though if you can, more power to you), but I think that any solution that addresses the scaling problem for any manually constructed glyph cluster will be a valuable contribution to the community.    For a slightly different setup (original example code) with  \RequirePackage{fix-cm} \documentclass[12pt]{memoir} \usepackage{fixltx2e}[2006/09/13] \usepackage{amsmath} \usepackage{txfonts} \usepackage[only,llbracket,rrbracket,llparenthesis,rrparenthesis]{stmaryrd} \usepackage{accsupp}   in the preamble, one needs \mkern-5.7mu in the fourth argument to \mathchoice for "correct" scaling. To see what goes wrong in that case, it's best to include a line such as discontinuous small symbols in a footnote\footnote{\(\scriptscriptstyle\llbrace \frac{a}{b} \rrbrace\)}. This might help a potential answerer test things out.
99337
I would like to learn Plain TeX and I'm reading Knuth's "The TeXBook". At Chapter 7, Knuth talks about the \string command and how it converts control sequences into lists of characters tokens.  Why when I typed  \string\TeX, I got "TeX, but when I wrote {\tt \string\TeX} I got \TeX ?  I guess it's something related to \escapechar, because when I changed that control sequence the output changed too:  \escapechar=`^ \string\TeX   it generates ^TeX.
65694
I've got a FileUpload control in an ASP.NET web page which is used to upload a file, the contents of which (in a stream) are processed in the C# code behind and output on the page later, using HtmlEncode.   But, some of this output is becoming mangled, specifically the symbol '£' is output as the Unicode FFFD REPLACEMENT CHARACTER. I've tracked this down to the input file, which is Windows 1252 ('ANSI') encoded.   The question is,   How do I determine whether the file is encoded as 1252 or UTF8? It could be either, and How do I convert it to UTF8 if it is in Windows 1252, preserving the symbol £ etc?   I've looked online but cannot find a satisfactory answer.
1735
In order to store results in the newly released (Winter 16') Platform Cache, I need an alphanumeric string, but currently have a String with the report name that I'm attempting to store, some of which have spaces, hyphens, parenthesis, etc. (i.e. "Sales - Actual Results (TY)").  I'm not sure in APEX how I would strip all these unwanted characters from the string to convert it into the alphanumeric key that I need.  Please &amp; Thank you!
61185
I'm trying to remove some characters from file(UTF-8). I'm using tr for this purpose:   tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat    File contains some foreign characters (like "Латвийская" or "àé"). tr doesn't seem to understand them: it treats them as non-alpha and removes too.  I've tried changing some of my locale settings:  LC_CTYPE=C LC_COLLATE=C tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=C tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat LC_CTYPE=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8 tr -cs '[[:alpha:][:space:]]' ' ' &lt;testdata.dat   Unfortunately, none of these worked.  How can I make tr understand Unicode?
28145
I am trying to input code listings with unicode characters and everything seems to work (more or less) except some unicode characters being displayed out of order. For example instead of  służąca do obsługi  I get  łżąsuca do łobsugi  How can I fix that? EDIT: I was asked for providing some code, but unfortunately I doubt it will be any helpful. Basically code like this: \documentclass[11pt,polish]{article}  \usepackage{fontspec} \usepackage{listings} \usepackage{xunicode} \usepackage{xltxtra} \usepackage{babel}  \setmainfont{Charis SIL} % Some font with good unicode support  \begin{document} \begin{lstlisting} służący \end{lstlisting} \end{document}  will output this:  łżą sucy  (yes there is a line break, I don't know where it came from, when I input code in form of a file there are characters out of order, but no line breaks).
20412
I was looking for a generic method in .Net to encode a string for use in an Xml element or attribute, and was surprised when I didn't immediately find one.  So, before I go too much further, could I just be missing the built-in function?    Assuming for a moment that it really doesn't exist, I'm putting together my own generic EncodeForXml(string data) method, and I'm thinking about the best way to do this.    The data I'm using that prompted this whole thing could contain bad characters like &amp;, &lt;, &quot;, etc.  It could also contains on occasion the properly escaped entities: &amp;amp;, &amp;lt;, and &amp;quot;, which means just using a CDATA section may not be the best idea.  That seems kinda klunky anyay; I'd much rather end up with a nice string value that can be used directly in the xml.  I've used a regular expression in the past to just catch bad ampersands, and I'm thinking of using it to catch them in this case as well as the first step, and then doing a simple replace for other characters.    So, could this be optimized further without making it too complex, and is there anything I'm missing? :  Function EncodeForXml(ByVal data As String) As String     Static badAmpersand As new Regex("&amp;(?![a-zA-Z]{2,6};|#[0-9]{2,4};)")      data = badAmpersand.Replace(data, "&amp;amp;")      return data.Replace("&lt;", "&amp;lt;").Replace("""", "&amp;quot;").Replace("&gt;", "gt;") End Function   Sorry for all you C# -only folks-- I don't really care which language I use, but I wanted to make the Regex static and you can't do that in C# without declaring it outside the method, so this will be VB.Net  Finally, we're still on .Net 2.0 where I work, but if someone could take the final product and turn it into an extension method for the string class, that'd be pretty cool too.  Update The first few responses indicate that .Net does indeed have built-in ways of doing this.  But now that I've started, I kind of want to finish my EncodeForXml() method just for the fun of it, so I'm still looking for ideas for improvement.  Notably: a more complete list of characters that should be encoded as entities (perhaps stored in a list/map), and something that gets better performance than doing a .Replace() on immutable strings in serial.
92309
I have a string:   allPunctuation = '~!@#$%^*()_+|}{":?&gt;&lt;`=;/.,][-\'\\';   This string contains APEX's way of escaping characters so I can include the ' and the \ characters.   When I pass this string into the replaceAll() method I get back an error because the escape characters are not carried over and the regex needs the escape characters. Is there a way around this?  ie: when I system.debug allPunctuation I get back: ~!@#$%^*()_+&#124;}{":?>&lt;`=;/.,][-'\ This clearly doesn't have the escape characters anymore.   My second thought was to utilize the matcher method. Documentation found here:    I am not sure why, but it is returning back a false. To me it seems like it shouldn't be affected by the escape quotes. And legalName has all sorts of punctuation in it.   Pattern NonAlphanumeric = Pattern.compile('[^a-zA-Z0-9 ]'); Matcher matcher = NonAlphanumeric.matcher(legalName); //system.debug(matcher) ---&gt; false   Could someone point me in the right direction?
62370
What prerequisites are needed to do strict Unicode programming?  Does this imply that my code should not use char types anywhere and that functions need to be used that can deal with wint_t and wchar_t?  And what is the role played by multibyte character sequences in this scenario?
1416
I want to use unicode character 2259 "estimates" in my document, but cannot find it in the symbols-a4 list or via .  It looks exactly like this: ≙  The closest I get is \triangleq: ≜, but it has a different meaning.