Questions tagged [escaping]
Escaping is the process of applying an alternate meaning to a character or set of characters.
38 questions
2
votes
2
answers
401
views
Wielding .NET masterfully to encode non-alphanumeric characters into utf-8 hex representation
I have these two methods that work, but I also hate because they almost certainly can be improved. I'm hoping to gain some guidance from others who are more knowledgable of .NET's offering for ...
1
vote
2
answers
217
views
Parse string using character value for Unicode characters
I added the getCValue method to reduce the cyclomatic complexity, but the cyclomatic complexity still persists. How can I reduce it? Can I change this code using ...
0
votes
3
answers
1k
views
url encoding and storing (JS, PHP, MySQL) [closed]
This question is about how best to encode, send and store information between JavaScript, PHP, and MySQL
I am doing a GET request from HTML/JavaScript to my PHP server, which is then storing the data ...
3
votes
1
answer
585
views
Ask for user input and again on the same line
A function that asks for user input according to some criteria and again on the same line if the criteria is not met. It requires that escape character sequences be enable.
...
1
vote
2
answers
1k
views
Golang - Splitting a string by a separator not prefixed by an escape string
I need to split a string by a separator but don't want to split if the separator is prefixed by the escape string.
For example:
...
1
vote
1
answer
624
views
Method encodes all less than (<) characters in a HTML string, but not the HTML tags
I am cleaning a HTML string to encode the less than sign (<) to a HTML entity (<), but leaving the HTML tags as they are. An example is converting ...
6
votes
1
answer
419
views
binary data shell echo generator
edit: here is a cleaned-up version incorporating most (but not all) feedback, thanks guys; https://gist.github.com/divinity76/79efd7b8c0d7849b956cd194659c98e5
edit2, 2021-07-16: found a bug (possible ...
1
vote
0
answers
2k
views
Escaping invalid XML characters (e.g. for the Java DOM API)
I want to save and load an arbitrary Java String in a Text node in a XML file using the Java DOM API.
The ...
7
votes
1
answer
398
views
Rust echo implementation that supports command line options
I rewrote echo from the manpage to learn Rust, and got the following:
...
6
votes
1
answer
123
views
POSIX+ implementations of echo(1)
Ever wanted a strictly conformant echo(1) implementation on your system? Wait no more: I've built it!
What is it?
My first large-ish body of C code in a while.
...
2
votes
1
answer
2k
views
PHP santization of textarea input
My application will accept textarea content that is submitted by a user, and i would like some people to review my code to make sure there is no security vulnerability such as XSS.
My mySQL column ...
2
votes
1
answer
153
views
Unquoting booleans, numbers, etc. in a JSON string
I have a method that takes a JSON string as input and "fixes" it. By that, I mean, that the JSON string comes in with all values quoted. My method un-quotes the values that shouldn't be quoted (i.e. ...
1
vote
2
answers
513
views
Balanced parenthesis, with backslash escaping
Given a Balanced Parenthesis problem.
"Balanced Parenthesis
Create a program that checks if in a given string expression all the parenthesis are balanced.
For Example:
(test) - valid
...
3
votes
1
answer
209
views
htmlspecialchars() equivalent in C
I'm trying to write an equivalent of PHP's htmlspecialchars() in C. What is my implementation missing or doing wrong?
...
6
votes
1
answer
3k
views
Python program that obfuscates an email address
I decided to resume my (limited) Python skills after not coding for a long time.
Here's a very simple self-contained program to convert the characters of an email address into their HTML entities (...