special-characters

How to chech Bosnian-specific characters in RegEx?

拜拜、爱过 提交于 2019-12-24 12:42:18
问题 I have this Regular Expression pattern, which is quite simple and it validates if the provided string is "alpha" (both uppercase and lowercase): var pattern = /^[a-zA-Z]+$/gi; When I trigger pattern.test('Zlatan Omerovic') it returns true , however if I: pattern.test('Zlatan Omerović'); It returns false and it fails my validation. In Bosnian language we have these specific characters: š đ č ć ž And uppercased: Š Đ Č Ć Ž Is it possible to validate these characters (both cases) with JavaScript

Powershell: Replace special characters

扶醉桌前 提交于 2019-12-24 11:46:00
问题 Is there an easy way to replace special characters, like æøåéü etc., from a string in a Powershell script? Making the string web-safe. 回答1: Ok, with additional explanation, I guess solution would depend on a scale. If that's user input and in "normal" use it would be short, that maybe something like that: $Replacer = @{ Å = 'aa' é = 'e' } $string_to_fix = 'æøåéüÅ' $pattern = "[$(-join $Replacer.Keys)]" [regex]::Replace($string_to_fix, $pattern, { $Replacer[$args[0].value] }) Obviously, you

Importing csv embedding special character with numpy genfromtxt

北城余情 提交于 2019-12-24 10:25:44
问题 I have a CSV containing special characters. Some cells are arithmetic operations (like "(10/2)"). I would like to import these cells as string in numpy by using np.genfromtxt. What I notice is that it actually import them in UTF8 (if I understood). For instance everytime I have a division symbol I get this code in the numpy array :\xc3\xb7 How could I import these arithmetic operations as readable string? Thank you! 回答1: Looks like the file may have the 'other' divide symbol, the one we learn

RegExp and special characters

巧了我就是萌 提交于 2019-12-24 07:31:14
问题 I need to use regexp for matching and the code below works fine. However, I need to KEEP the dollar sign ($) as a true dollar sign and not a special character. I've tried excluding but nothing is working. IE: [^$] Here's the code. It works as expected except when the text contains a $ or IS the $. textNode = "$19,000"; regex = RegExp("$19,000",'ig'); text = '$'; textReplacerFunc: function (textNode, regex, text) { var sTag = '<span class="highlight">'; var eTag = '</span>'; var re = '(?![^<>]

PHP Replace umlaut characters to parse XML; several methods not working

蓝咒 提交于 2019-12-24 05:44:14
问题 I have the following problem: I have a php page which parses an XML file. The php gets an ID, then queries the database to get the information from that ID and outputs this info as XML. As it happens, there are special characters in the DB, specifically [é, è, ö, ä, ü.. etc ]. The file is saved as UTF-8 (I tried saving as UTF-16, but the output looked horrible). The php file looks like this: <?php header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="UTF-16" standalone="yes" ?

How can I use special characters in angular directives attributes?

别来无恙 提交于 2019-12-24 05:25:13
问题 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 "L�rm". Any ideas? 回答1: Usually in a good editor you can change the document encoding type, the document is saved in. try to set it to

don't want xslt intepret the entity characters

巧了我就是萌 提交于 2019-12-24 03:28:17
问题 The xml was like this: < cell i='0' j='0' vi='0' parity='Odd' subType='-1'> & #34;String& #39;</cell> But after the intepretion of the xsl, the output is like this: < td nowrap="true" class="gridCell" i="0" j="0">"String'< /td> I would like to keep the & #34; and & #39;. I've tried character map,but it doesn't work. The code is like this: < xsl:character-map name="raquo.ent"> <xsl:output-character character="'" string="&apos;"/> <xsl:output-character character="'" string="&apos;"/> < /xsl

Unwanted chars written from java REST-API to HadoopDFS using FSDataOutputStream

こ雲淡風輕ζ 提交于 2019-12-24 03:01:54
问题 We built a java REST-API to receive event data (like click on a buy button) and write that data to HDFS. Essentially we open streams for every host that is sending data (in JSON) or use existing ones, enrich data with a timestamp, an event name and hostname and write it into (FS)DataOutputStream: 1 public synchronized void writeToFile(String filename, String hostname, String content) throws IOException { 2 FSDataOutputStream stream = registry.getStream(filename, hostname); 3 stream.writeBytes

How to insert special language characters in PHP into MySQL database?

扶醉桌前 提交于 2019-12-24 02:32:55
问题 I am using latest PHP and latest MySQL. I have tried htmlspecialchars and mysql_real_escape_string but it inserts ? instead of the special character. I am inserting into varchar and text type fields. Special language characters like őúáűăţşîâ but it maight be other languages' characters. 回答1: Check the default encoding for your server, your meta-tag encoding declaration, and your collation on your database and tables are. You may want to make sure that everything is set to UTF8 if you're

How to insert special language characters in PHP into MySQL database?

不羁岁月 提交于 2019-12-24 02:31:13
问题 I am using latest PHP and latest MySQL. I have tried htmlspecialchars and mysql_real_escape_string but it inserts ? instead of the special character. I am inserting into varchar and text type fields. Special language characters like őúáűăţşîâ but it maight be other languages' characters. 回答1: Check the default encoding for your server, your meta-tag encoding declaration, and your collation on your database and tables are. You may want to make sure that everything is set to UTF8 if you're