special-characters

How can I write character & in android strings.xml

跟風遠走 提交于 2019-11-26 18:11:11
I wrote the following in the strings.xml file: <string name="game_settings_dragNDropMove_checkBox">Move by Drag&Drop</string> I got the following error: The reference to entity "Drop" must end with the ';' delimiter. How can I write character & in the strings.xml? Encode it: & For special character I normally use the Unicode definition, for the '&' for example: \u0026 if I am correct. Here is a nice reference page: http://jrgraphix.net/research/unicode_blocks.php?block=0 Hai Rom This is a my issues, my solution is as following: Use > for < , < for > , & for & , "'" for ' , &quot for \"\" Even

Special characters in PHP / MySQL

♀尐吖头ヾ 提交于 2019-11-26 17:49:52
I have in the database words that include special character (in Spanish mostly, like tildes). In the database everything is saved and shown correctly with PHPmyAdmin, but when I get the data (using PHP) and display it in a browser, I get a weird character, like a "?" with a square... I need a general fix so I don't need to escape each character every time, and also I would be able to insert special Spanish characters from a PHP form into the database... The HTML is correct: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> All tables and databas are set to utf8_spanish The

Batch file : how to search and replace a string that have an “=” inside

纵然是瞬间 提交于 2019-11-26 17:33:57
问题 i have to search a string from a txt like Pippo.K=5 and replace it with Pippo.K=1. I need to search the entire string. What i did is: set "search=Pippo.K=5" set "replace=Pippo.K=1" set "textFile=%SettingFile%.txt" for /f "delims=" %%i in ('type "%textFile%" ^& break ^> "%textFile%" ') do ( set "line=%%i" setlocal enabledelayedexpansion set "line=!line:%search%=%replace%!" >>"%textFile%" echo(!line! endlocal ) but what i returned is 5=Pippo.K=1=5 How can i fix this error? 回答1: The following

What are the allowed characters in a subdomain?

﹥>﹥吖頭↗ 提交于 2019-11-26 17:28:27
问题 What characters are you allowed to use in a subdomain? Example: for someSub.example.com the someSub portion. I know you can use letters, numbers, and hyphens, but what about other characters? Can _ (underscore) be used? 回答1: Letters (except stressed à), Numbers 0-9 and Hyphen. http://en.wikipedia.org/wiki/Domain_name excerpt: Valid characters that can be used in a domain name are: a-z 0-9 - but not as a starting or ending character . as a separator for the textual portions of a domain name

NSURL URLWithString: is null with non-english accented characters

99封情书 提交于 2019-11-26 17:27:52
问题 I have the following string... NSString *googleSearchString = @"http://www.google.com/search?q=lyrics+%22Tænder+På+Dig%22+%22Jakob+Sveistrup%22"; Notice that it has some accented characters. When I try to turn that into a url the returned url is null... [NSURL URLWithString:googleSearchString]; So normally the url works except when there are accented non-english characters in the string. Any help on how to handle that? 回答1: You need to escape the special characters to make it work properly.

Java: What does ~ mean

荒凉一梦 提交于 2019-11-26 17:25:33
In this Java source code I have this line: if ((modifiers & ~KeyEvent.SHIFT_MASK) != 0) .... What does the tilde ~ mean? Richard The Tilde ( ~ ) performs a bitwise complement of a numerical value in Java. See: Bitwise complement ( ~ ): inverts ones and zeroes in a number Pascal MARTIN It is the Unary ~ Bitwise complement operator (quoting) : only used with integer values inverts the bits ie a 0-bit becomes 1-bit and vice versa in all cases ~x equals (-x)-1 See also this page on Bitwise operators on wikipedia , which states : The bitwise NOT, or complement, is a unary operation that performs

Using Unicode characters in batch file

自作多情 提交于 2019-11-26 17:23:39
问题 I am making a batch file that uses these characters: ˧ ˥ ˪ ˫ It is not working, it just terminates itself. I have seen people use characters like this: Å It isnt the character but it turns into a character, can someone give me a list of these, shows the type of letter above and what it turns into? 回答1: If you want to write console batch files that use those characters, you need an editor that will save the batch file using the console's code page. To check what that is, type: C:\>chcp Active

Identifying and removing null characters in UNIX

爱⌒轻易说出口 提交于 2019-11-26 17:14:29
I have a text file containing unwanted null characters (ASCII NUL, \0 ). When I try to view it in vi I see ^@ symbols, interleaved in normal text. How can I: Identify which lines in the file contain null characters? I have tried grepping for \0 and \x0 , but this did not work. Remove the null characters? Running strings on the file cleaned it up, but I'm just wondering if this is the best way? Pointy I’d use tr : tr < file-with-nulls -d '\000' > file-without-nulls If you are wondering if input redirection in the middle of the command arguments works, it does. Most shells will recognize and

Alt attribute encoding with JavaScript

有些话、适合烂在心里 提交于 2019-11-26 17:13:58
问题 Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A → B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A → B'; and will produce A → B instead of A → B . How to do it through JavaScript, when it is not possible to put the special (unencoded) characters in the source code? 回答1: Here's an alternative if you can't save your file using a Unicode format:

How can I use a special char in a C# enum?

回眸只為那壹抹淺笑 提交于 2019-11-26 17:01:33
问题 For example: public enum Unit{ KW, kV, V, Hz, %V } In this case % is a special character. So, how can I put this char in a enum? 回答1: Enum members shouldn't be used for user interface display purposes. They should be mapped to a string in order to get displayed. You can create a string array (or a dictionary) that maps each enum member to a string for user interaction. That said, to answer your question directly, you can use \uxxxxV were xxxx is the hexadecimal number representing the Unicode