special-characters

Replace HTML entities (e.g. ’) with character equivalents when parsing an XML feed

久未见 提交于 2019-12-11 03:40:46
问题 When parsing an XML feed, I am getting text from the content tag, like this: The Government has awarded funding for a major refurbishment project to go ahead at St Eunan’s College. This is in addition to last month’s announcement that grant for its prefabs to be replaced with permanent accomodation. The latest grant will allow for major refurbishment to a section of the school to allow for new accommodation for classes – the project will also involve roof repairs, the installation of a dust

Write Special characters in a file

Deadly 提交于 2019-12-11 03:20:02
问题 I am trying to write data in a .eps file, Here is my code header('Content-Type: text/html; charset=utf-8');' $var = 'ê'; echo $var; $file = 'test.eps'; file_put_contents($file, $var); But when i open test.eps, the data written is ê it should have been ê Please Help ... 回答1: I believe you are dealing with either: The character encoding of the source code file you have created (make sure it is UTF-8!) The default encoding for file_put_contents is utf8, so you should be okay there but your OS

jquery Linkify: Firefox displaying “/#%21/…” instead of “/#!/…” in href attr after linkification

无人久伴 提交于 2019-12-11 03:08:50
问题 It's odd, I really don't know what else to check... I'm using this code for linkifying URLs... And the URLs with a hash like Twitter http://twitter.com/#!/username/status/1234567890 Firefox shows this on the href: http://twitter.com/#%21/username/status/1234567890 The link works, but unfortunately, this brokes the Embedly plugin to auto-embed Tweets. In Chrome and Safari both, the Link and the autoEmbed are working fine. I checked on Firefox with an url without the "#!" and it works too... So

PHP to detect and convert Special Characters?

烂漫一生 提交于 2019-12-11 03:07:41
问题 In PHP when i read the Data, let say the data (chunks of strings) is containing HTML Special Character DECIMAL HEX Codes like: This is a sample string with œ and š We can say above HEX codes are the source codes of its correspondence Symbol and these will be rendered as correct Symbols in Browser. But what i want to do is, for these characters (for example), i want these HEX(es) as the converted original Character Symbols like: This is a sample string with œ and š So how can i detect the any

Special characters and RODBC

大兔子大兔子 提交于 2019-12-11 02:57:28
问题 in a database I have strings stored that contain special characters such as "§". Using the command sqlQuery() from package RODBC "§" is translated to "?". This is also the case for characters such as " ' " as it can be found in French words. Of course I can not replace every "?" by one of the special characters after the query. Does anybody have an idea for this problem? I work under windows 7. As requested the out put of sessionInfo() R version 2.14.1 (2011-12-22) Platform: x86_64-pc-mingw32

str_replace not replacing special chars

流过昼夜 提交于 2019-12-11 02:46:35
问题 In a project of mine, I'm having a few upload forms. Since I live in Sweden, I want to encode the Swedish special characters to their respective HTML-code, so that encoding won't be an issue when displaying the data. Here's the code: function format_text($text){ $chars = ['å','ä','ö','Å','Ä','Ö']; $codes = ['å','ä','ö','&Aring','Ä','Ö']; foreach($chars as $key => $value){ $text = str_replace($value,$codes[$key],$text); } $text = str_replace("\r","\n",$text); $text = preg_replace("!\n\n+!", "

SQLite - Insert special symbols (trademark, …) into table

偶尔善良 提交于 2019-12-11 02:42:24
问题 How can I insert special symbols like trademark into SQLite table? I have tried to use PRAGMA encoding = "UTF-16" with no effect :( 回答1: Typically if you surround an SQL entry with ''Single quotes, it goes in as a literal. i.e. '™' 回答2: problem solved. it is necessary to open DB file with sqlite3_open16, then execute command PRAGMA encoding = \"UTF-16\"; (I am not sure, if it is necessary). Now the insert will be done with UTF-16. To select from db (to get column value) is necessary to use

What is the best invisible character can I use to replace  ?

☆樱花仙子☆ 提交于 2019-12-11 02:28:47
问题 I use some telerik report to print some report. I need to use Telerik.Reporting.TextBox to print labels. Some labels are stock in .txt files, like " Apple". When I see a label with spaces, it means I have to indent it in the report, so in the TextBox. The thing is when we export the report in pdf, we have the indentation, but not when we see in the browser. If I replace the spaces by "& nbsp;", we see the indentation in the browser, but when exporting to pdf, we see the "& nbsp;". One way to

PHP: Convert specific-Bosnian characters to non-bosnian (utf8 standard chars)

浪子不回头ぞ 提交于 2019-12-11 02:05:23
问题 In Bosnia we have following characters only used in latin-form in Bosnia and Croatia, so I'd need to convert these letters as following: FROM | TO ć | c č | c ž | z š | s đ | dj If this is possible with some special form of RegEx, or utf8_encode/decode, that informatiion and an appopriate example will be quite welcome! Thanks all. PS - Want to achive this in PHP! 回答1: You can use this with iconv. $result = iconv("UTF-8", "ASCII//TRANSLIT", $text); That will work assuming your input $text is

Find the % character in a LIKE query

寵の児 提交于 2019-12-11 01:57:03
问题 I've an SQL database and I would like to do a query who show all the datas containing the sign "%". Normally, to find a character (for example: "z") in a database I use a query like this : mysql_query("SELECT * FROM mytable WHERE tag LIKE '%z%'"); But here, I want to found the % character, but in SQL it's a joker so when I write: mysql_query("SELECT * FROM mytable WHERE tag LIKE '%%%'"); It show me all my datas. So how to found the % character in my SQL datas ? Thanks 回答1: You can escape the