special-characters

problem with special characters

旧街凉风 提交于 2019-12-02 12:56:19
问题 I am retrieving articles from my blog to my webiste from the mysqlDb. The articles are displayed just fine on the blog but on the website some characters such as ţ,ş,ă etc are replaced with a black square with a question mark inside . I have "UTF-8" set on my document the same as on the blog. 回答1: You need to tell to MySQL that the connection must be made in UTF-8. To do so use the function mysql_set_charset (you need PHP 5.2.3). If you use PHP < 5.2.3 try : mysql_query("SET character_set

Python adds special characters to path-string

大憨熊 提交于 2019-12-02 11:32:47
问题 I am trying to work with a path in Python 2.7 This is what I am trying to do in my main class: program = MyProgram() program.doSomething('C:\Eclipse\workspace\MyProgram\files\12345678_Testing1_ABCD005_Static_2214_File12.txt') Inside the function doSomething(filePath) the string already looks like this: So there is a kind of special character plus some characters are removed copletely. What could cause this problem? 回答1: \ is escape char in Python. According to docs, you have created string

how to replace all occurrence of string between two symbols?

只谈情不闲聊 提交于 2019-12-02 10:20:00
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 (intIndexOfMatch != -1){ strReplaceAll = strReplaceAll.replace(/<.*>/,'') intIndexOfMatch = strReplaceAll

Get string from between two characters

孤街浪徒 提交于 2019-12-02 09:47:52
问题 I need to get string from between two characters. I have this S= "10:21:35 |Manipulation |Mémoire centrale |MAJ Registre mémoire" and it have to return 4 strings each in a variable: a=10:21:35 b=Manipulation c=Mémoire centrale d=MAJ Registre mémoire 回答1: There's String#split. Since it accepts a regular expression string, and | is a special character in regular expressions, you'll need to escape it (with a backslash). And since \ is a special character in Java string literals, you'll need to

Filed values changes unexpectedly using checkbox

假如想象 提交于 2019-12-02 08:53:50
问题 I have multiple checkbox and their field name but i dont know where i have done wrong the name of the field changes i am unable to find out where is the problem. Here my screen shot when checkbox values were fine:here is fine fields working good And this here is screen shot there is multiple questions marks like ???? and these becoming annoying this fields value are with ???? there should not any question marks in this field And my form where these checkboxes value are: <form id="preferences

UTF-8 Character Encoding in SQL

ε祈祈猫儿з 提交于 2019-12-02 07:32:30
问题 I am trying out Bullzip's Access to mySQL app on an Access DB full of special chars like é and ä. The app allows you to specify UTF-8 encoding but in the resulting SQL file I get "Vieux Carré" instead of "Vieux Carré". I tried opening the SQL file in UltraEdit and doing a UTF-8 conversion but it does not resolve this issue as I guess it is converting "é" and never sees the "é"? What is a Good™ solution for this? 回答1: The problem is in the UTF-8 to Unicode conversion into or out of Access.

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

青春壹個敷衍的年華 提交于 2019-12-02 07:14:00
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 subfolders "1" and "2" under Temp So you now have: C:\1 C:\2 C:\ \first C:\ \second For such C:\Temp folder

MySQL selecting string with special characters

馋奶兔 提交于 2019-12-02 06:12:54
问题 I'm having a problem selecting strings from database. The problem is if you have McDonald's in row and if you are searching with a string mcdonalds it wouldn't find any results. Any suggestions? I forgot to mention that I'm using LIKE in WHERE sentence. 回答1: If your search requirements are to ignore certain characters, you can remove them during a search by replace ing them with a blank. This answer solves your problem: SELECT * FROM restaurants WHERE replace(name, '''', '') like '%mcdonalds%

Special characters pose problems with REST webservice communication

最后都变了- 提交于 2019-12-02 05:35:30
I am trying to post a JSON-object to a REST webservice from an Android application. Everything works fine until I add special characters like å, ä, ö. JSONObject absenceObject = new JSONObject(); absenceObject.put(INFO_DESCRIPTION, "åka pendeltåg"); StringEntity entity = new StringEntity(absenceObject.toString()); httpPost.setEntity(entity); httpPost.setHeader("Accept", "application/json";character); httpPost.setHeader("Content-type", "application/json;charset=UTF-8"); HttpResponse response = httpclient.execute(httpPost); If I print absenceObject.toString() and copy the result in to a regular

Can I make a code in python that ignores special characters such as commas, spaces, exclamation points, etc?

狂风中的少年 提交于 2019-12-02 05:29:59
I want to create a code that will return "true" (if I type in a palindrome regardless of case or if there are special characters in it), and "false" otherwise. The code I have so far works for phrases with no special characters such as commas, apostrophes, spaces, etc. def is_palindrome(my_str): my_str= my_str.casefold() rev_str= reversed(my_str) if list(my_str) == list(rev_str): print("True") else: print("False") when I do: print (is_palindrome("Rats live on no evil star")) it returns True because it is a palindrome when I do: print (is_palindrome("Hello World!")) it returns False because it