character-encoding

PHP Strange character before £ sign?

蓝咒 提交于 2019-12-31 04:36:07
问题 For some reason i get a  £76756687 weird character when i type a £ into a text field on my form? 回答1: As you suspect, it's a character encoding issue - is the page set to use a charset of UTF-8? (You can't go wrong with this encoding really.) Also, you'll probably want to entity encode the pound symbol on the way out ( £ ) As an example character set (for both the form page and HTML email) you could use: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> That said, is

How does one go from a Unicode character to its description?

喜你入骨 提交于 2019-12-31 03:48:09
问题 I came across this cute little symbol today: 🔮 I couldn't figure out what it was, so I searched for reverse lookup services and character maps that might be able to reveal a name to no avail. I know, however, that Windows' character map program knows the names of symbols: How does Windows accomplish this? How might I, but a lowly programmer, divine this same knowledge? What encoding system does Unicode use to tie a symbol to its description? 回答1: This information comes from the Unicode

Using “En Dash” in an input file to a batch file

落花浮王杯 提交于 2019-12-31 03:22:06
问题 Most tragically, I got several TFS team projects with an en dash in them. If you are not familiar with en dash, open up MS Word and type in alt+8211. You will see a larger looking dash. (Like this if it renders for you: –). If you open notepad you will see a ? and if you try it in most Unicode editors you will see ‼. But I need it to be a dash. Because I need to run a batch file against all my projects. The paths to the projects now has this en dash in it. I make a file that holds the names

Convert Special Characters for RTF

有些话、适合烂在心里 提交于 2019-12-31 02:44:26
问题 Can someone please assist me with converting special characters to something that can be correctly represented in an RTF file? I am taking text stored in a string on the iPad and outputting it as an RTF file using NSASCIIStringEncoding. So far so good. What I've neglected to do successfully, is take into account special characters (e.g. tilde, umlaut, accent, etc.) . Sorry RoW! The most universal RTF format seems to want 8-bit text encoding with code page escape (two hexadecimal digits

Print Arabic or other charset in System.out

时光怂恿深爱的人放手 提交于 2019-12-31 02:42:26
问题 I'm tyring to print a String with Arabic characters: private static void print(String msg, Object... args) { try { PrintStream ps = new PrintStream(System.out, true, "ISO-8859-6"); ps.println(String.format(msg, args)); } catch (UnsupportedEncodingException error) { System.err.println(error); System.exit(0); } } However, I see from the Eclipse log console that the Arabic characters as displayed as series of these kind of characters èååêÒÉ What could be missing in my code? 回答1: try this:

Return file download from byte[]

允我心安 提交于 2019-12-31 01:48:09
问题 This code string xml = XmlHelper.ToXml(queryTemplate); byte[] xmlb = StringHelper.GetBytes(xml); var cd = new System.Net.Mime.ContentDisposition { // for example foo.bak FileName = String.Format("{0}_v{1}.xml", queryModel.Name, queryModel.Version), // always prompt the user for downloading, set to true if you want // the browser to try to show the file inline Inline = false, }; Response.AppendHeader("Content-Disposition", cd.ToString()); return File(xmlb, "application/xml"); Turns out the

Encoding.GetEncoding(437).GetString() bug?

烂漫一生 提交于 2019-12-30 17:36:13
问题 I have following test program char c = '§'; Debug.WriteLine("c: " + (int)c); byte b = Encoding.GetEncoding(437).GetBytes("§")[0]; Debug.WriteLine("b: " + b); char c1 = Encoding.GetEncoding(437).GetString(new byte[] { 21 })[0]; Debug.WriteLine("c1: " + (int)c1); This produces following result: c: 167 b: 21 c1: 21 As I can see here GetBytes is working correctly 167 in unicode => 21 in CP437 but GetString is not working 21 in CP437 => 21 in unicode Is this a bug or my mistake? 回答1: CP437 is not

C++ spanish question mark

房东的猫 提交于 2019-12-30 11:54:10
问题 I am beginning developing in C++ and I am developing a simple calculator in console and when my program ask to the user if wants to exit,the character '¿' doesn't appear (The questions in spanish are between '¿' and '?') Can someone help me? PD: The problem only happens in Windows,not in Linux EDIT: Here is the code that output the code: cout << '¿' <<"Desea salir (S/N)? " ; 回答1: There are a few ways to deal with this problem. The fundamental problem is not that the ¿ doesn't exist in the

Accented characters not correctly imported with BULK INSERT

99封情书 提交于 2019-12-30 11:07:23
问题 I am importing a source CSV file, I don't know the source encoding and I can only see either � (ANSI encoding) or � (UTF8-without-BOM encoding) when I open a the file with Notepad++ (related question). This file has been imported to the database mssql-2008 using bulk insert : DECLARE @bulkinsert NVARCHAR(2000) SET @bulkinsert = N'BULK INSERT #TempData FROM ''' + @FilePath + N''' WITH (FIRSTROW = 2,FIELDTERMINATOR = ''","'',ROWTERMINATOR =''\n'')' EXEC sp_executesql @bulkinsert This is then

Java: Detect non-displayable chars for a given Character Encoding

浪尽此生 提交于 2019-12-30 10:53:31
问题 I'm currently working on an application to validate and parse CSV-files. The CSV files have to be encoded in UTF-8, although sometimes we get files in a false encoding. The CSV-files most likely contain special characters of the German alphabet (Ä, Ö, Ü, ß) as most of the texts within the CSV file are in German language. For the part of the validator, i need to make sure, the file is UTF-8 encoded. As long as there are no special characters present, there is most likely no problem with