special-characters

What exactly is the linear whitespace? (LWS/LWSP)

和自甴很熟 提交于 2019-12-02 20:27:09
I saw mention of the term, along with CRLF, CR, LF, CTL (control characters) and SP (space). If it's not the regular inline whitespace ( ), so what character(s) is it? From STD68 Augmented BNF for Syntax Specifications: ABNF LWSP = *(WSP / CRLF WSP) ; Use of this linear-white-space rule permits ; lines containing only white space* WSP = SP / HTAB ; white space CRLF = CR LF ; Internet standard newline SP = %x20 ; space HTAB = %x09 ; horizontal tab CR = %x0D ; carriage return LF = %x0A ; linefeed The comment on LWSP has changed in STD68 (aka RFC5234) from RFC2234 and RFC4234 and now gives advice

Escaping special character when generating an XML in Java

ぃ、小莉子 提交于 2019-12-02 20:14:50
I am trying to develop an XML export feature to give my application users to export their data in an XML format. I have got this feature ready and working until it started failing for some cases. Then I realized that it was because of some special characters that needs to be encoded. for example the data might contain & or ! or % or ' or # etc. etc. and this needs to be escaped properly. I was wondering if there is a generic utility available that can escape all of the special characters as per the XML specification. I couldn't find anything on Google. Is there something like that already

How to run mysql command on bash?

南楼画角 提交于 2019-12-02 19:56:07
The following code works on the command line mysql --user='myusername' --password='mypassword' --database='mydatabase' --execute='DROP DATABASE myusername; CREATE DATABASE mydatabase;' However, it doesnt work on bash file on excecution #!/bin/bash user=myusername password=mypassword database=mydatabase mysql --user='$user' --password='$password' --database='$database' --execute='DROP DATABASE $user; CREATE DATABASE $database;' I receive the following error: ERROR 1045 (28000): Access denied for user '$user'@'localhost' (using password: YES) How to make the bash file run as the command line?

How to interpret special characters in command line argument in C?

会有一股神秘感。 提交于 2019-12-02 18:55:25
问题 First problem: Suppose we write a simple program which takes in command line arguments and prints to a file. If the user enters writetofile Hello!0\n w%orl\t!@#y bash replies with !0: event not found. Without the user knowing things like using quotes ('') or escape characters ('\'), how do I handle this stuff instead of bash understanding it as a command? Second problem: Once I get these arguments, how do I interpret them as special characters and not sequences of characters. (ie. \t is tab,

Why Subversion skips files which contain the @ symbol?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 18:50:55
when I try to execute command like this (from a command-line or Perl script - it doesn't matter): svn revert "build\myfile@test.meta" SVN skips this file and outputs: Skipped 'build\myfile' I tried doing: svn revert "build\*.meta" But it gives the same result. I can revert these files from the GUI. And I can revert these files by doing (but it reverts more than I want): svn revert --recursive "build" Is there a workaround for this? The @ sign in filenames in Subversion actually has a special meaning - a pegged revision number. To quote the Subversion book : The perceptive reader is probably

How can I decode HTML entities?

心已入冬 提交于 2019-12-02 18:09:46
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. Telemachus Take a look at HTML::Entities : use HTML::Entities; my $html = "Snoopy & Charlie Brown"; print decode_entities($html), "\n"; You can guess the output. The

how to replace all occurrence of string between two symbols?

五迷三道 提交于 2019-12-02 16:09:33
问题 I'm working with RegEx on Javascript and here is where I stuck. I have a simple string like <html><body><span style=3D"font-family:Verdana; color:#000; font-size:10pt;= "><div><font face=3D"verdana, geneva" size=3D"2">http://72.55.146.142:8880/= order003.png.zip,120</body></html> all i need to do is write javascript which can replace all strings in with "<" and ">" symbol. I wrote something like this - var strReplaceAll = Body; var intIndexOfMatch = strReplaceAll.indexOf( "<" ); while

What is the first character in the sort order used by Windows Explorer?

夙愿已清 提交于 2019-12-02 15:24:33
For example, in a Windows folder, if we create some files and name them 1.html, 2.txt, 3.txt, photo.jpg, zen.png the order will be as is. But if we create another file with the name _file.doc it will be placed at the top. (considering we sort by name in descending order) likewise, what would be the character that would be considered as the first, such that if i use that character, it would place the file on top of the hierarchy? The first visible character is '!' according to ASCII table.And the last one is '~' So "!file.doc" or "~file.doc' will be the top one depending your ranking order. You

GetDirectories fails to enumerate subfolders of a folder with #255 name

回眸只為那壹抹淺笑 提交于 2019-12-02 13:49:41
问题 My application is C# 3.5 runs on Windows 7 Ultimate, 64 bit. It goes through all folder subfolders to perform its job. However, it fails (falls into the infinite loop until StackOverflow.com exception) if run against the folder which name is only one symbol which is #255. To reproduce, you can do the following: run Windows Explorer create C:\Temp folder in this folder create new folder and rename it with Alt-255 (using numeric keypad) create subfolders "first" and "second" there create

How to interpret special characters in command line argument in C?

女生的网名这么多〃 提交于 2019-12-02 13:27:29
First problem: Suppose we write a simple program which takes in command line arguments and prints to a file. If the user enters writetofile Hello!0\n w%orl\t!@#y bash replies with !0: event not found. Without the user knowing things like using quotes ('') or escape characters ('\'), how do I handle this stuff instead of bash understanding it as a command? Second problem: Once I get these arguments, how do I interpret them as special characters and not sequences of characters. (ie. \t is tab, not '\''t') That is, how do make sure that the program writes this to the file: Hello!0 w%orl !@#y and