special-characters

Json file to powershell and back to json file

∥☆過路亽.° 提交于 2019-12-19 03:22:38
问题 I am trying to manipulate json file data in powershell and write it back to the file. Even before the manipulation, when I just read from the file, convert it to Json object in powershell and write it back to the file, some characters are being replaced by some codes. Following is my code: $jsonFileData = Get-Content $jsonFileLocation $jsonObject = $jsonFileData | ConvertFrom-Json ... (Modify jsonObject) # Commented out this code to write back the same object $jsonFileDataToWrite =

what does $* mean in a shell script

那年仲夏 提交于 2019-12-19 00:25:34
问题 What does $* exactly mean in a shell script? For example consider the following code snippet $JAVA_HOME/bin/java/com/test/Testclass $* 回答1: It means all the arguments passed to the script or function, split by word. It is usually wrong and should be replaced by "$@" , which separates the arguments properly. 回答2: It's easy to find answer by yourself: man bash → /\$\* : Special Parameters The shell treats several parameters specially. These parameters may only be referenced; assignment to them

what does $* mean in a shell script

谁说我不能喝 提交于 2019-12-19 00:25:08
问题 What does $* exactly mean in a shell script? For example consider the following code snippet $JAVA_HOME/bin/java/com/test/Testclass $* 回答1: It means all the arguments passed to the script or function, split by word. It is usually wrong and should be replaced by "$@" , which separates the arguments properly. 回答2: It's easy to find answer by yourself: man bash → /\$\* : Special Parameters The shell treats several parameters specially. These parameters may only be referenced; assignment to them

special characters (emoticons) in text file

吃可爱长大的小学妹 提交于 2019-12-18 14:36:16
问题 I have a txt file of an conversation exported from WhatsApp. WhatsApp supports emoticons in their conversation, and the exported conversation also, to my surprise, contains these emoticons! That is, if I open the text file in a text editor (Text Wrangler on Mac 10.8) I can see the emoticons. The text file is encoded in UTF-8 and there are no resources associated with the file that I can tell. Can anyone explain to me how these emoticons are being included in the text file and how they are

special characters (emoticons) in text file

别等时光非礼了梦想. 提交于 2019-12-18 14:33:34
问题 I have a txt file of an conversation exported from WhatsApp. WhatsApp supports emoticons in their conversation, and the exported conversation also, to my surprise, contains these emoticons! That is, if I open the text file in a text editor (Text Wrangler on Mac 10.8) I can see the emoticons. The text file is encoded in UTF-8 and there are no resources associated with the file that I can tell. Can anyone explain to me how these emoticons are being included in the text file and how they are

Export html table to Excel javascript function special characters changed

我的未来我决定 提交于 2019-12-18 13:37:47
问题 I have the following function that exports an html to excel: function generateexcel(tableid) { var table= document.getElementById(tableid); var html = table.outerHTML; window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html)); } One problem is that the especial characters in the data are transformed to other symbols: 1º = 1º é = é How would you fix this? Is there any character replace to the html to prevent it? Any encoding option? 回答1: Replacing chars is a poor solution. I

How to match with regex all special chars except “-” in PHP?

荒凉一梦 提交于 2019-12-18 13:11:51
问题 How can I match all the “special” chars (like +_*&^%$#@!~ ) except the char - in PHP? I know that \W will match all the “special” chars including the - . Any suggestions in consideration of Unicode letters? 回答1: [^-] is not the special character you want [\W] are all special characters as you know [^\w] are all special characters as well - sounds fair? So therefore [^\w-] is the combination of both: All "special" characters but without - . 回答2: \pL matches any character with the Unicode

PHP mail special characters in subject field

强颜欢笑 提交于 2019-12-18 13:09:44
问题 I would like to insert special characters in the subject of HTML e-mails sent with the PHP mail() function. I want my subject to look like this: ★ Your new account I have tried with an HTML entity like ★ (★) or by pasting the symbol directly in my code but that doesn't work either, except on a few e-mail clients. $to = 'me@example.com'; $subject = '★ Your new account or ★ Your new account'; $message = 'HTML message...'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .=

Convert ' to an apostrophe in PHP

一个人想着一个人 提交于 2019-12-18 12:53:08
问题 My data has many HTML entities in it ( • ...etc) including ' . I just want to convert it to its character equivalent. I assumed htmlspecialchars_decode() would work, but - no luck. Thoughts? I tried this: echo htmlspecialchars_decode('They're here.'); But it returns: They're here. Edit: I've also tried html_entity_decode(), but it doesn't seem to work: echo html_entity_decode('They're here.') also returns: They're here. 回答1: Since ' is not part of HTML 4.01, it's

PHP ldap_add function to escape ldap special characters in DN syntax

自作多情 提交于 2019-12-18 12:29:09
问题 I'm trying to add some users to my Ldap DB but I get some errors (invalid dn syntax) when I use some special characters like ",.". I need a function that escape all characters. I try preg_quote but I get some errors in some cases. Thanks in advance Code: $user = 'Test , Name S.L'; if(!(ldap_add($ds, "cn=" . $user . ",".LDAP_DN_BASE, $info))) { include 'error_new_account.php'; } 回答1: EDIT Jan 2013: added support for escaping leading/trailing spaces in DN strings, per RFC 4514. Thanks to