FAQ Database Discussion Community


PHP SQL find ™ and other special characters

php,mysql,database,special-characters
I have a large dB table where I need to search and replace certain char etc. Some of these are special char. First I am trying just find before changing the statement to Update replace type. Below runs ok for $Search_for = '%apple%'; But fails on Special char So for...

Using Special Characters in Java (using primitive char)

java,arrays,char,special-characters,primitive
I'm basically trying to build a random password generator in Java. I'm trying to build it using a char array, basically: char[] password = new char[8] I want to be able to include "special" characters in this array (such as @, $, *, etc). Can these characters be placed in...

Ionic - meta charset doesn't work

angularjs,cordova,special-characters,ionic,htmlspecialchars
In my index, I've inserted this: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> And if I use a special character (like à or •) in the index it's displayed correctly. For example, in the header I can use special character. But if I use it in one of the view,...

how to remove special chars like this █ from string in php

php,preg-replace,special-characters
how to remove only this type of special chars ░▒▓█► from a string in php I use this preg_replace('/[\x00-\x1F\x80-\xC0]/u', '',$string); but i want to allow special char like à,â, ', ", for french language ...

MYSQL CSV import Characters turn into '?'

mysql,phpmyadmin,special-characters,mysqlimport,excel-import
I am new to MySQL and facing this trouble since many days ,please pardon my technical terminology. After researching a lot and failing I decided to post the question. I am using PHP and MYSQL to create customers web application. The data from user comes in an excel file which...

SQL Issue using SUBSTRING and LEN

sql,sql-server,tsql,substring,special-characters
SELECT [Code], [Due Date Calculation], --original string that is causing the error --SUBSTRING([Due Date Calculation], 1, LEN([Due Date Calculation]) - 1) as OG, --here are the tests that run fine by themselves LEN([Due Date Calculation]) - 1 as Test1, SUBSTRING([Due Date Calculation], 1, 2) AS Test2, SUBSTRING([Due Date Calculation], 1,...

csharp using sql query with special characters

c#,sql,sql-server,special-characters
I have a scenario in my csharp code where I am trying to get records with special characters / and % using sql query. I tried executing query in sql query analyzer and it worked fine after adding square brackets. Select * from tblDetails where name like '%[\]%' or name...

MsgBox with Scripting.FileSystemObject's File.Path does not display Cyrillic characters

vba,special-characters
I am walking through all files in a folder. When I hit a file name that includes these special characters "Информационное письмо" the special characters are turned into "?" - question marks. Please how can I get the original file name this way? Code: Dim objFolder As Object Dim objFile...

Special charaters show square box in webservice response

android,parsing,dictionary,textview,special-characters
Here is the word pronounciation coming in my web services response tækˈsɑ:nəmi but when i show it android textview it shows like this tækËsÉ:nÉmi And also sometime it shows Square boxes in place of some characters when i show it in android textview. Please guide or suggest some solution. Ali...

curl post request failing in the presence of special characters

python,json,curl,unicode,special-characters
Ok, I know there are too many questions on this topic already; reading every one of those hasn't helped me solve my problem. I have " hello'© " on my webpage. My objective is to get this content as json, strip the "hello" and write back the remaining contents ,i.e,...

How to use plus character in regex

java,regex,special-characters
I have written a snippet, but it doesn't work correctly. I have an input in this format: Arg2+res=(s11_19,s11_20,s11_21,s11_22),Arg4-res=() It can contain multiple Args (e.g. Arg1, Arg2, ...). What I want, is to return +resinstances. For example, in the above example, I need this part: Arg2+res=(s11_19,s11_20,s11_21,s11_22) My Regex is like the...

Escaping Special Characters in Import for Neo4j

neo4j,special-characters,backticks
In my where clause I am trying to escape a special character "#" by following the manual's recommendation regarding backticks when creating a node: WHERE line.`The #` IS NOT NULL AND line.`Person's First/Last Name` IS NOT NULL However, when I do this, I get message: No data returned, and nothing...

Php fails to build an array with character ö

php,mysqli,prepared-statement,special-characters
From what I can tell, PHP fails on building array with special character. Not sure where or why this is happening and how to solve. function findRelated($subpass){ $subpass = "$subpass%"; global $mysqli; if($stmt = $mysqli->prepare("SELECT pass FROM `passwords` WHERE pass LIKE ? LIMIT 500")) { $stmt->bind_param('s', $subpass); if(!$stmt->execute()) { $stmt->close();...

printing special characters without spaces

python,printing,special-characters
I made a for loop to write a little program that has an if condition. I want to print a number and put it between '' without any space. Here is a portion of my program : for y in range(2): print(' if a ==','\'',y,'\'' ,'and',' b ==','\'',y,'\'',':') My output...

Remove weird invalid character in ruby

ruby,encoding,character-encoding,special-characters
I have some XML content (UTF-8), that contains invalid characters (nokogiri tells me Line 2190, SyntaxError: PCDATA invalid Char value 15 when I try to parse the content with Nokogiri::XML(content)). The character is displayed in Sublime Text editor as a "SI": When I try to copy the character, nothing gets...

MS Access Text Field Special Characters

ms-access,special-characters
I have a search button that executes this applyfilter macro code: [ContractNumber] Like "*" & [Forms]![frmContractMatch&Revenue]![Text44] & "*" So it searches text box text44 for the appropriate ContractNumber. The trouble I am having is that if a contract number is ART#45 for example, it will not find it in the...

Special character length

c,special-characters
I found something really strange today. In the code above, I saw that utrlen(&eot) (utrlen == strlen) is equal to two, and utrlen(&etx) == 1. The best part : when I swap the order of declaration with etx, utrlen(&eot) == 1 and utrlen(&etx) == 2... char **get_ukey_string() { static char...

while converting list to string getting an extra [ in java

java,string,list,special-characters
While I am converting a list, which is having the data from hibernate query list. list = query.list(); String str= list.toString(); String strArr[] = str.split("\\r?\\n"); list = Arrays.asList(strArr); that list is having extra [ at beginning and extra ] at the end of the data. How to remove this?...

Php doesn't support math characters

php,shell,special-characters,equation
I'm in the process of converting latex to mathml in php.Texmath is the command line tool through which the conversion process can be done. Latex file: \mathbf{f} = (f_{1}, f_{2})^{\prime} test.php: shell_exec('echo "password" | sudo -S /root/.cabal/bin/texmath latexfile > outputfile'); If I run this php file thorugh command line,it generates...

Git: Remove directory with quotes and backslashes from repo

git,directory,repository,special-characters
I have a directory in my git repository (but not on my local system) named "my\\directory-name" It contains two quotation marks and two backslashes. The problem is that with this directory in my repo it is not possible to checkout the contents completely because (error message:) git doesn't find a...

Remove folder with special character on it

linux,delete,directory,special-characters,rename
I accidentally created some folders with special characters. I already read the other posts in stackoverflow, but don't work. When I type the ls -la command I see [email protected]:/myfolder# ls -la drwxr-xr-x 3 root root 4096 feb 6 17:53 , drwxr-xr-x 70 root root 4096 feb 11 10:27 . drwxr-xr-x...

RichTextBox and special chars c#

c#,special-characters,richtextbox,rtf
I need to put text with RTF format in a richtextbox, I try to put it with the richtextbox.rtf = TextString parameter, but the problem is that the string has special chars and the richtextbox does not show all the string correctly. The String and code that I am using:...

Has a character in python a regular expression special function?

python,regex,special-characters
Is there an easy way to verify that the given character has a special regex function? Off course I can collect regex characters in a list like ['.', "[", "]", etc.] to check that, but I guess there is a more elegant way....

Automatically reading data files containing special characters in Matlab

matlab,special-characters
I would like to import a data file in Matlab which is generated by an external software automatically. This data file can occasionally contain special characters in its third column at random places. Therefore, I cannot simply utilize dlmread. I'm figuring out how to import this file automatically in Matlab...

PHP DOMDocument: what is the nicest way to safely add text to an element

php,xml,special-characters,domdocument
When adding a string that might contain troublesome characters (eg &, <, >), DOMDocument throws a warning, rather than sanitizing the string. I'm looking for a succinct way to make strings xml-safe - ideally something that leverages the DOMDocument library. I'm looking for something better than preg_replace or htmlspecialchars. I...

In Oracle, How do I alter a user that have a special character in the name?

oracle,special-characters,alter-table,user-accounts
I am using Oracle 11g and I need to unlock an specific user but this user have a dot in the name.For Example lets say my user name is 'foo.mock'. I know that adding this kind of characters in user names is not a good practice but I dont administrate...

How do I remove copyright and other non-ASCII characters from my Java string?

java,string,special-characters
I’m using Java 6 (not an option to upgrade at this time). I have a Java string that contains the following value: My Product Edition 2014© The last symbol is a copyright symbol (©). When this string outputs to my terminal (using bash on Mac 10.9.5), the copyright symbol renders...

PHP – Why does some umlaut characters show while others don't?

php,character-encoding,output,special-characters,diacritics
This is a simplified version of the code I'm currently working with – why does it work fine when using a basic echo, but fails when trying to write only a part of the string? Should I add any encode/decode/locale/utf to make this work, in that case how? <meta charset="utf-8">...

VBA to remove special characters before saving workbook

vba,excel-vba,special-characters
I found this function to remove special characters. Function Remove_Characters(s As String) As String Static RegEx As Object If RegEx Is Nothing Then Set RegEx = CreateObject("VBScript.RegExp") With RegEx .Global = True .Pattern = "\\|/|:|\*|""|\?|<|>\|| " End With End If Remove_Characters = RegEx.Replace(s, "") End Function What I want to...

Change cyril to western characters (both in utf-8) - php

php,utf-8,character-encoding,special-characters,cyrillic
I've got a problem with cyril characters. Our site is in utf-8 and accepts these characters, however our external sources where we pass on characters does not accept them. We are trying to pass on persons names. They have other different charsets (for example iso-8859-1). Is there any easy way...

How to handle below pattern matching in Perl

regex,perl,pattern-matching,special-characters
How to do the below mentioned pattern match? Below input is in an array: @array=("gs : asti:34:234", "gs : asti:344:543:wet"); I used foreach loop so that I split them and I'm pushing them into an array. Help me in resolving the below issue. foreach(@array) { if($_ =~ /gs/ig) { my...

How to encode special characters in e-mail-adresses

perl,email,encoding,special-characters
E-Mail-Adresses do not only consist of this parts: [email protected] The complete string in the next line (including the part between the quotation marks, the quotation marks itself and the angle brackets) is also a valid address: "John Doe" <[email protected]> And when I replace "John Doe" with my own name, I...

Get substring between two spesific characters in python

python,string,special-characters
I am really confused that can't write a code that do this for me. Look This is my string: a="hello | my friends| in | stack | over | flow" I want to print "my friends" which is between first and second "|" Please help me...

Regular expression is working online and not in Eclipse

java,regex,eclipse,special-characters
I have escaped special characters and verified that the string passed to the Pattern is what I want. I printed it on the screen and all double slashes were single again. Particularly, I want these to be found: \z.\s.\f.jtuy \z.yu \aw.o lambda expressions. My regex is (\\[a-z]{1,}\.){1,}[a-z]{1,} and it -...

Remove special character from data frame in R before and after text

r,special-characters
I have the following data frame 1 +PAL+PEA+ + + + I want to remove the '+' before and after the text and get something like 1 PAL+PEA ...

Formatting string with Regex in java, how do I convert captured group to special character?

java,regex,unicode,special-characters
I have a set of commands that include hidden characters, written in a text file. One by one, they get read and sent a server to execute commands. Its very important that special characters be formatted properly, however they cannot simply be written in the text file as "\u0002", for...

Special characters in javascript onClick paramerters

javascript,onclick,special-characters
I have a javascript onclick function. I am passing certain values which has special characters inside onclick. <a href="#" onclick="editLocation(34:B1:F7:D5:BB:52)">click</a> which gives me an error How do i pass all the value inside onclick.. I don't want to ignore special character. I must pass the complete value 34:B1:F7:D5:BB:52...

How to convert a letter character into the corresponding escaped special character

c++,special-characters
I need a function that would give me the escaped special character from the letter character. It would apply only when it makes sense: 't', 'n', 'r', 'b', 'f', 'v'. Right now, here is my implementation: typedef struct SpecialCharacter { SpecialCharacter( char letter, char special ) { m_letter = letter;...

Why python regex match function matches that special character? [closed]

python,regex,match,special-characters
I have regex pattern "^[a-zA-z0-9]+$" As I understand it should describe a word or something like that. I try to verify a string like "counter": re.match("^[a-zA-z0-9]+$", "counter") # Result: <_sre.SRE_Match object at 0x000000AA2053C578> # If I have special character like "/" it won't match (returns nothing). re.match("^[a-zA-z0-9]+$"), "coun/ter") But if...

Sending an arrow key with fprintf

c,linux,special-characters,ipc,popen
I'm testing out pipes and have hit a little road block. I want to be able to simulate pressing the right arrow key through a file pointer opened by popen. The file pointer opens a display program on a different terminal, much like a projector. I would like to send...

Special characters in CSS selector

css,special-characters
I found this CSS definition in the semantic UI. They use this style extensively. .ui.\32.buttons > .button, .ui.two.buttons > .button { width: 50%; } I can see what they are trying to accomplish. They want the CSS definition to read .ui.2.buttons > .button, It must be ASCII code. Code \32...

Convert special character '&' , '>' and '<' to their respective character reference for XML

php,xml,special-characters
I need to replace only these 3 symbol for my XML: & to &amp; < to &lt; > to &gt; I used htmlspecialchars but it will replace single and double quotes too....

How do you escape pipe character in bitbucket markdown?

special-characters,markdown,bitbucket
I would like to add the following to a bitbucket wiki: Key | Description |Default | :-----------|:----------------------------------------------|:--------------| env |Execution context {development|test|production}|development | Markdown has a backslash escape for many characters, but not pipe (|). I saw one solution using {development&#124;test&#124;production} but this does not work as you can't use html...

Rscript: how is $ interpreted in strings passed as inline code

r,special-characters,rscript
Does anyone know how $ is interpreted within an inline call to rscript? In the example below, I am trying to get z to be the "a" element within the x list. However, z=x$a gives me x instead of the element of the list. > Rscript -e "x = list(a=c(1,2,3),...

Use special characters in the CSS content

css,unicode,special-characters
Which is the correct way of using it? Unicode or just the character itself, although the results look the same. h1:before { content: "\263A"; } h1:after { content: "☺"; } <h1>Smile</h1> ...

How can I use special characters in angular directives attributes?

javascript,angularjs,utf-8,special-characters,directive
I would like to use strings including german characters (Ä, Ö, Ü) in attributes of a custom angularJS directive. For example: <my-custom-directive my-label="Lärm" /> Another example is the ui.bootstrap.tabs directive: <tabset> <tab heading="Lärm"> content ... </tab> <tab heading="Second Heading"> content ... </tab> </tabset> This results in a tab with heading...

PHP - Put special characters from a string into another string

php,preg-match,special-characters
I have a function that I want to tell me what special characters are in a string. I don't want to strip them I want to put into another variable. if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $string)) { $special_characters = special characters from $string } Is there a way to do this? Thanks...

Replace special characters in string [closed]

ruby,string,special-characters
I have strings like "Ruby & Rails" "Ruby& Rails" "Ruby !Rails" I want to convert them to "Ruby-Rails". How can I do this?...

TCPDF for PHP creates empty PDF when special (slovic) character đ is used

php,pdf,special-characters,tcpdf
I'm using TCPDF to generate PDFs (obviously). All has been well, but now I'm trying to make a PDF with the character "đ" (which apparently is a slovic character). The data is user-generated, so I won't know if they're planning on using these type of characters or not - that's...

Java FileWriter lost special characters [duplicate]

java,special-characters,filewriter
This question already has an answer here: Java BufferedWriter object with utf-8 3 answers I've this code //write a file in a specific directory public static void writeFile(String comment, String outputFileName) { FileWriter fWriter = null; BufferedWriter writer = null; try { fWriter = new FileWriter(outputFileName,true); writer = new...

topoJSON is not correctly converting special chars from geojson like ë or ó

special-characters,flags,qgis,topojson
I really need these special (ë or ó) characters in my topoJSON file. I use QGIS and export the data as geojson. Here the special chars are all fine, still correct in the output. But when I now use topoJSON to bring all my geoJSON files together, all the special...

All special characters are question marks in PHP/HTML

php,character-encoding,special-characters
Php default character set is UTF-8. All special characters in PHP and HTML are outputting as question mark like "?" in the browser. All data with special characters are stored as UTF-8 in database fields. But when PHP reads the database and output to browsers, all special characters like copyright...

Using an apostrophe inside a query

php,mysql,special-characters
So using prepared statements im trying to query with a ' i have a string called $awayteam wich holds : SSS'18 VR1 When i try to query the DB with above string it wont work.... $conn = new PDO($link, $pdo_username, $pdo_password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare("SELECT * FROM clublogo WHERE...

check if the string begin with euro/pound symbol

php,string,special-characters
I'm trying to check if a string is start with '€' or '£' in PHP. Below are the codes $text = "€123"; if($text[0] == "€"){ echo "true"; } else{ echo "false"; } //output false If only check a single char, it works fine $symbol = "€"; if($symbol == "€"){ echo...

Meaning of characters and symbols of T-SQL syntax

sql-server,tsql,syntax,sql-update,special-characters
Below is the syntax for the UPDATE statement in SQL Server. I guess in my past, I understood some of the symbols/characters in syntax definitions, but never really truly understood all of the symbols/characters mean with SQL syntax. Can someone help me understand what the following mean in the syntax...

sed string with special character New

linux,sed,special-characters
when i use this script to replace : mrm.fr.mycompany.com by 10.70.89.40:8081/artifactory sed -i -e "s/mrm.fr.mycompany.com/10.70.89.40:8081/artifactory/g" config.xml i have the error : sed: -e expression n°1, caractère 41: option inconnue pour `s' can anyone help me thanks in advance regard, Youssef...

Error in Exploding variables with Specail Characters

php,special-characters,explode
$html = file_get_contents('abc.com/abc'); // create document object model $dom = new DOMDocument(); // load html into document object model @$dom->loadHTML($html); // create domxpath instance $xPath = new DOMXPath($dom); // get all elements with a particular id and then loop through and print the href attribute $elements = $xPath->query("//*[@class='f16']"); foreach ($elements...

How to remove special character from data frame

r,data.frame,special-characters
I have imported data from a url and converted it to a data frame using the following code: url <-"http://apims.doe.gov.my/v2/hourly2.php" tables<- readHTMLTable(url) try<-do.call(rbind, lapply(tables, data.frame, stringsAsFactors=FALSE)) The data has '*' next to the numbers. I would like to isolate the numbers only. So instead of 52* 45* 67* 55* I...

Gson library when parse string contain special char \u

gson,special-characters
I have a simple code like that: JsonParser parser = new JsonParser(); JsonElement element = parser.parse("{\"description\":\"c:\\userDescription.txt\"}"); JsonObject attributes = element.getAsJsonObject(); System.out.println(attributes); I expect the outout is: {"description":"c:\userDescription.txt"} but actually I have the exeption: Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "serD" Can you help me, what should the...

Lucene 5.0.0 - search string with special characters

lucene,special-characters
I am using Lucene version 5.0.0. In my search string, there is a minus character like “test-”. I read that the minus sign is a special character in Lucene. So I have to escape that sign, as in the queryparser documentation: Escaping Special Characters: Lucene supports escaping special characters that...

How to display an ip in normal character

python,special-characters,ip-address
I have a problem with my script. For a test i want to print an src and dst ip address but the characters displayed are special and after many researches i still don't understand why ... I'm sure this is a simply problem but i didnt get it ... This...

Mysql slash asterisk bang [duplicate]

mysql,sql,special-characters
This question already has an answer here: How can I get rid of these comments in a MySQL dump? 13 answers I just realized that there are lines in the sql files (.sql) which start with /*! and are NOT comments and they are executed to do some system...

How to store input text value or text area value with & symbol and special characters? [closed]

php,mysql,string,special-characters,htmlspecialchars
I have already checked with htmlentities, htmlspecialchars, mysql_real_escape_string but nothing helped me. I just want to save "Hello my name is john & my native is chennai" when i tried to save this, only "Hello my name is john " is saved. what should i do to store & symbol...