special-characters

How to encode U+FFFD in order to do a replace?

眉间皱痕 提交于 2019-12-12 17:55:20
问题 In a text file I obtain from a source I do not control, and which text content changes periodically and I have to compensate by re-downloading and processing, the char U+FFFD occurs frequently (but not always) when what is meant is the single quote or ' character. How can I encode a replace operation so as to replace the U+FFFD with an actual single-quote in C#. I envision something like: string s = s.Replace("U+FFFD", "'"); Clearly I should use the overload that deals with char, but I am not

Is there a list of Special characters to be avoided in JCL/MVS Script variables

天涯浪子 提交于 2019-12-12 14:22:00
问题 I have a program that generates random pin codes. These pins are generated in Java, then stored in the mainframe, via a NATURAL program. From there, they are eventually physically printed by a batch JCL job that calls an MVS SCRIPT to print the form, with the pin code on it. I've come across some issues with special characters before such as: |{}![]^~<>; that for one reason or another do not print properly. I've also removed 0OQ1l for OCR reasons. Recently, an error came to my attention with

How to properly decode accented characters for display

你。 提交于 2019-12-12 12:23:38
问题 My raw input file text file contains a string: Caf&eacute (Should be Café) The text file is a UTF8 file. The output lets say is to another text file, so its not necessarily for a web page. What C# method(s) can i use to output the correct format, Café ? Apparently a common problem? 回答1: Have you tried System.Web.HttpUtility.HtmlDecode("Café") ? it returns 538M results 回答2: This is HTML encoded text. You need to decode it: string decoded = HttpUtility.HtmlDecode(text); UPDATE: french symbol "é

How to set up your username in Git if it contains special characters?

社会主义新天地 提交于 2019-12-12 11:18:12
问题 Hey there. I'm using Git for windows (The msysgit project). And working with the GIT Bash. I'm also pushing my programmed stuff to gitHub. The problem is that my gitHub's user name contains a "č" character and the GIT Bash won't let me type that in. Is there a way of setting my --global user.name within my GIT settings to contain that "č" character? Thanks. 回答1: git config --edit will open your gitconfig [1] in an editor, you can set it by hand there. [1] you can also specify these flags to

Is it possible to display an alternate character with CSS?

时间秒杀一切 提交于 2019-12-12 10:38:06
问题 I am using a web font that has several different, "M's" to choose from, in the glyphs panel. The default "M" that keeps being displayed in my website is hideous. I would like to use a better looking "M" from one of the font's alternate character choices. In the glyphs panel (within Illustrator) the "M" character I want to use is: U+004d Alternates#2 (aalt2) I have this currently in my CSS: .script:before { content: "\004D"; } Unfortunately, this code does not pull the alternate "M" I want. It

How can I use ':' character in a name of XDocument element?

穿精又带淫゛_ 提交于 2019-12-12 10:36:12
问题 I'm using XDocument to create a RSS same below code: var document = new XDocument( new XDeclaration("1.0", "utf-8", null), new XElement("rss", new XElement("channel", new XElement("title", "test"), new XElement("dc:creator", "test"), An exception occurring during the execution of this code. The ':' character, hexadecimal value 0x3A, cannot be included in a name. How can I use : character in a name of element? 回答1: To use namespaces, you'll need to create the namespace object first: UPDATED

How to add a carriage return as a character to a file?

℡╲_俬逩灬. 提交于 2019-12-12 08:13:25
问题 I wanna have a string like: blablbabla<carriage return goes here> I mean the string should contain the carriage return. Is there any simple way to do it? Or if a write a program in c and use fputs with blablabla\r , does this do the trick? 回答1: If you're using vim you can enter insert mode and type 'CTRL-v CTRL-m'. That ^M is the keyboard equivalent to \r. (see Insert the carriage return character in vim) Inserting 0x0D in a hex editor will do the task. 回答2: echo -ne "blablbabla\r" > /path/to

Convert ASCII and UTF-8 to non-special characters with one function

扶醉桌前 提交于 2019-12-12 08:09:27
问题 So I'm building a website that is using a database feed that was already set up and has been used by the client for all their other websites for quite some time. They fill this database through an external program, and I have no way to change the way I get my data. Now I have the following problem, sometimes I get strings in UTF-8 and sometimes in ASCII (I hope I've got these terms right, they're still a bit vague to me sometimes). So I could get either this: Scénic or Scénic . Now the

PHP 5.6 upgrade and special characters

岁酱吖の 提交于 2019-12-12 07:29:11
问题 I have a website where I've used php to include sections rather than having code be duplicated for each page. However, recently my webhost upgraded the PHP to 5.6, and now all my Æ, Ø and Å's give me the replacement character (�). I'm not running any databases, and setting a charset in the html didn't help. I'm very inexperienced with PHP, so I have no idea how to fix it. Please, any help would be great! 回答1: I had the same problem after upgrading from php 5.5. to 5.6. Solved it by setting

Replace an expression with special characters by another in shell script or sed [duplicate]

淺唱寂寞╮ 提交于 2019-12-12 06:48:40
问题 This question already has answers here : Is it possible to escape regex metacharacters reliably with sed (2 answers) Closed last year . In a file x , a line containing 4*4 4*1 4*4 4*0 is to be replaced by 4*4 4*1 3*4 1*4 4*0 which is in file y . I'm using the following code: #!/bin/bash old=`grep "4*4" x`; new=`grep "4*4" y`; sed -i "s/${old}/${new}/g" x but it yields no change at all in x . I'm a novice and this might be a silly question for this site but I'm unable to replace this