special-characters

Checking if a character is a special character in Java [duplicate]

筅森魡賤 提交于 2019-11-30 13:27:00
Possible Duplicate: JAVA: check a string if there is a special character in it I am a novice programmer and am looking for help determining if a character is a special character. My program asks the user to input the name of a file, and the program reads the text in the file and determines how many blanks spaces, digits, letters, and special characters are in the text. I have the code completed to determine the blanks, digits, and letters, however am unsure of how to check if a character is a special character. Any help you can offer is appreciated and if something was not clear enough I can

special characters (emoticons) in text file

别等时光非礼了梦想. 提交于 2019-11-30 11:19:55
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 accurately being interpreted by the Text Editor? Is this related to the character encoding at all? Are

Non US characters in section headers for a UITableView

时间秒杀一切 提交于 2019-11-30 10:50:51
问题 I have added a section list for a simple Core Data iPhone app. I followed this so question to create it - How to use the first character as a section name but my list also contain items starting with characters outside A-Z, specially Å,Ä and Ö used here in Sweden. The problem now is that when the table view shows the section list the three last characters are drawn wrong. See image below alt text http://img.skitch.com/20100130-jkt6e55pgyjwptgix1q8mwt7md.jpg It seems like my best option right

Check NSString for special characters

人走茶凉 提交于 2019-11-30 10:32:12
问题 I want to check an NSString for special characters, i.e. anything except a-z, A-Z and 0-9. I don't need to check how many special characters are present, or their positions, I just need to know whether a particular string contains any or not. If it does, then I want to be able to display "Error!", or something similar. For example, jHfd9982 is OK but asdJh992@ is not. Also, letters with accents, diacritics, etc. should not be allowed. How would I go about this? Thanks! Michael 回答1:

Allowing punctuation characters in directory and file names in bash

馋奶兔 提交于 2019-11-30 09:41:39
问题 What techniques or principles should I use in a bash script to handle directories and filenames that are allowed to contain as many as possible of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ and space? I guess / is not a valid filename or directory name character in most linux/unix systems? So far I have had problems with ! , ; , | , (a space character) and ' in filenames. 回答1: You are right, / is not valid, as is the null-byte \0 . There is no way around that limitation (besides file system hacking).

bash scripting - read single keystroke including special keys enter and space

岁酱吖の 提交于 2019-11-30 09:20:37
Not sure if I should put this on stackoverflow or unix.stackexchange but I found some similar questions here, so here it goes. I'm trying to create a script to be called by .bashrc that allows me to select one of two options based on a single keystroke. That wouldn't be hard normally but I want the two keys corresponding to the two options to be space and enter. Here's what I got so far: #!/bin/bash SELECT="" while [[ "$SELECT" != $'\x0a' && "$SELECT" != $'\x20' ]]; do echo "Select session type:" echo "Press <Enter> to do foo" echo "Press <Space> to do bar" read -s -N 1 SELECT echo "Debug/

PHP mail special characters in subject field

ⅰ亾dé卋堺 提交于 2019-11-30 09:04:14
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 &starf; (&starf;) 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 &starf; Your new account'; $message = 'HTML message...'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $headers .= 'From: Me <me@example.com>' . "\r\n"; mail

Convert &apos; to an apostrophe in PHP

半城伤御伤魂 提交于 2019-11-30 08:18:15
My data has many HTML entities in it ( • ...etc) including &apos; . 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&apos;re here.'); But it returns: They&apos;re here. Edit: I've also tried html_entity_decode(), but it doesn't seem to work: echo html_entity_decode('They&apos;re here.') also returns: They&apos;re here. Since &apos; is not part of HTML 4.01, it's not converted to ' by default. In PHP 5.4.0, extra flags were introduced to handle different languages,

JSTL escaping special characters [duplicate]

江枫思渺然 提交于 2019-11-30 08:10:56
This question already has an answer here: XSS prevention in JSP/Servlet web application 8 answers I have this weird issue with special characters. In JSP, I am using field name as id and the name can be anything like id="&lt;1 and &>2" (OR) id="aaa & bbb" I don't have any other option to use ID's other than names, that what the only thing I get from backend. So, Is there any logic to remove all the special characters using JSTL. With the present scenario, In JS I will do some operations with the ID. this is causing many issues for each kind of browser. Please suggest, Thanks in advance... JB

How to insert special characters into a database?

夙愿已清 提交于 2019-11-30 07:08:10
问题 Can anyone tell me how to insert special characters into a MySQL database? I've made a PHP script which is meant to insert some words into a database, although if the word contains a ' then it wont be inserted. I can insert the special characters fine when using PHPmyAdmin, but it just doesn't work when inserting them via PHP. Could it be that PHP is changing the special characters into something else? If so, is there a way to make them insert properly? 回答1: $insert_data = mysql_real_escape