special-characters

How can I decode HTML entities?

假装没事ソ 提交于 2019-12-03 05:43:56
问题 Here's a quick Perl question: How can I convert HTML special characters like ü or ' to normal ASCII text? I started with something like this: s/\&#(\d+);/chr($1)/eg; and could write it for all HTML characters, but some function like this probably already exists? Note that I don't need a full HTML->Text converter. I already parse the HTML with the HTML::Parser . I just need to convert the text with the special chars I'm getting. 回答1: Take a look at HTML::Entities: use HTML::Entities; my $html

Replacing a character by another character in a string in android?

回眸只為那壹抹淺笑 提交于 2019-12-03 05:15:13
Simply i want to replace a character with another in android.. My code: et = (EditText) findViewById(R.id.editText1); String str = et.getText().toString(); str.replace(' ','_'); et.setText(str); System.out.println(str); But here the "space" is not replaced by "underscore".. I also tried other character too.. please help!! Strings are immutable in Java - replace doesn't change the existing string, it returns a new one. You want: str = str.replace(' ','_'); (This is definitely a duplicate, but I don't have enough time right now to find an appropriate one...) String is immutable and you cannot

C# Remove special characters

邮差的信 提交于 2019-12-03 05:14:11
I want to remove all special characters from a string. Allowed characters are A-Z (uppercase or lowercase), numbers (0-9), underscore (_), white space ( ), pecentage(%) or the dot sign (.). I have tried this: StringBuilder sb = new StringBuilder(); foreach (char c in input) { if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') | c == '.' || c == '_' || c == ' ' || c == '%') { sb.Append(c); } } return sb.ToString(); And this: Regex r = new Regex("(?:[^a-z0-9% ]|(?<=['\"])s)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); return r

How do you spell/pronounce all the special characters and symbols [closed]

泪湿孤枕 提交于 2019-12-03 04:48:08
I sometimes need to look for information for a special portion of code. When this code concerns or contains a special character ( ° , * , # , ... etc), that is not always recognized in search engines, I often end up having to ask a new question because I do not know how to write these characters in plain text. Can anybody give me a link to a sort of English dictionary of all these signs and symbols? You need the Jargon file . Amongst al the fantastic definitions (in the glossary section) is a list of ASCII symbols and what they're called. Sadly, a lot of these characters have multiple names,

php with special characters like ñ

喜你入骨 提交于 2019-12-03 03:31:35
At first I thought the problem was when I return echo json_encode($row) from an ajax call that results with ñ are changed to NULL. But after testing I found out that the problem exists way before that. In a sample php file with: $test = "Nuñez" echo $test the result is just Nu�ez I've searched around but none of the suggested solutions work. Like: mb_internal_encoding('UTF-8'); mb_http_output('UTF-8'); mb_http_input('UTF-8'); mb_language('uni'); mb_regex_encoding('UTF-8'); ob_start('mb_output_handler'); or <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> , or header(

Converting special charactes such as ü and à back to their original, latin alphbet counterparts in C#

假装没事ソ 提交于 2019-12-03 01:52:47
I have been given an export from a MySQL database that seems to have had it's encoding muddled somewhat over time and contains a mix of HTML char codes such as & uuml; and more problematic characters representing the same letters such as ü and à . It is my task to to bring some consistency back to the file and get everything into the correct Latin characters, e.g. ú and ó . An example of the sort of string I am dealing with is Desinfektionslösungstücher für Flächen Which should equate to 50 Tattoo Desinfektionsl ö sungst ü cher f ü r Fl ä chen 50 Tattoo Desinfektionsl ö sungst

Use of special characters in function names

空扰寡人 提交于 2019-12-03 01:20:51
In Ruby, a standard convention is to use a question mark at the end of a method name to indicate the method returns a boolean result: [].empty? #=> true Another standard convention is to end a method name with an exclamation point if the method is destructive (that is, it modifies the original data): mylist.sort! # sort mylist in-place Recently I have seen these same conventions used in Scheme. Which makes me wonder, what other languages use/support this convention? Are there any other special characters that are commonly used for naming by these or other languages? The answer is, of course,

li:before{ content: “■”; } How to Encode this Special Character as a Bullit in an Email Stationery?

别说谁变了你拦得住时间么 提交于 2019-12-03 01:17:35
问题 After proudly coloring my liststyle bullet without any image url or span tags, via: ul{ list-style: none; padding:0; margin:0; } li{ padding-left: 1em; text-indent: -1em; } li:before { content: "■"; padding-right:7px; } Although these stylesheets work perfectly down to the rounded borders and other css3 stuff, and although the recipient of the email (for instance, Eudora OSE 1) renders all css styles correctly, just like in a browser, there is one problem: the bullets like • or ■ become

Wordpress search failed on special characters due to improper decode

≯℡__Kan透↙ 提交于 2019-12-02 22:15:11
I am implementing the Wordpress search functionality. When I search for text " Division's " (which is a text in one of the posts), It returns "No results found" Now to investigate further, I checked the core file: wp-includes/query.php => function parse_search() And found that the $term is received encoded as : Division\xe2\x80\x99s Now this term is not decoded properly. And the final SQL statement formed is : (((test_posts.post_title LIKE '%Division\xe2\x80\x99s%') OR (test_posts.post_content LIKE '%Division\xe2\x80\x99s%'))) So, I want to decode the special characters to succesfully search

Replace Both Double and Single Quotes in Javascript String

六眼飞鱼酱① 提交于 2019-12-02 21:43:37
I am pulling in some information from a database that contains dimensions with both ' and " to denote feet and inches. Those characters being in my string cause me problems later and I need to replace all of the single and double quotes. I can successfully get rid of one or the other by doing: this.Vals.replace(/\'/g, "") To get rid of single quotes or this.Vals.replace(/\"/g, "") To get rid of double quotes How do I get rid of both of these in the same string. I've tried just doing this.Vals.replace(/\"'/g, "") and this.Vals.replace(/\"\'/g, "") But then neither get replaced. You don't escape