character-encoding

Stored non-English characters, got '?????' - MySQL Character Set issue

筅森魡賤 提交于 2019-12-29 08:23:05
问题 My site that I am working on is in Farsi and all the text are being displayed as ????? (question marks). I changed the collation of my DB tables to UTF8_general_ci but it still shows ??? I ran the following script to change all the tables but this did not work as well. I want to know what am I doing wrong <?php // your connection mysql_connect("mysql.ord1-1.websitesettings.com","user_name","pass"); mysql_select_db("895923_masihiat"); // convert code $res = mysql_query("SHOW TABLES"); while (

Powershell script runs when pasted into Powershell, but not when run from shortcut

有些话、适合烂在心里 提交于 2019-12-29 08:11:53
问题 I am trying to put together a script that will convert several excel files into PDFs. This is my first time doing something like this in Powershell. I found a link to one online that works. $path = Read-Host -Prompt 'Input Directory Path and Press Enter' $xlFixedFormat = “Microsoft.Office.Interop.Excel.xlFixedFormatType” -as [type] $excelFiles = Get-ChildItem -Path $path -include *.xls, *.xlsx -recurse $objExcel = New-Object -ComObject excel.application $objExcel.visible = $false foreach($wb

is possible to have accent sensitive and case insensitive utf8 collation in mysql?

…衆ロ難τιáo~ 提交于 2019-12-29 07:43:02
问题 How can I perform accent-sensitive but case-insensitive utf8 search in mysql? Utf8_bin is case sensitive, and utf8_general_ci is accent insensitive. 回答1: There doesn't seem to be one because case sensitivity is tough to do in Unicode. There is a utf8_general_cs collation but it seems to be experimental, and according to this bug report, doesn't do what it's expected to when using LIKE. If your data consists of western umlauts only (ie. umlauts that are included in ISO-8859-1), you might be

Character set that is not a superset of ASCII

元气小坏坏 提交于 2019-12-29 07:32:21
问题 Is there a character set other than EBCDIC that is not a superset of 7-bit ASCII? 回答1: Yes. JIS X 0208 is not a superset of ASCII. Some versions of this standard include most of the ASCII characters, but not all of them. A related fact is that a file encoded with UTF-16 or UTF-32 is not byte-equivalent to an ASCII file of the same characters, but since those are not character sets, and since Unicode is certainly a superset of ASCII, they do not qualify as answers to your question. 回答2: There

Character set that is not a superset of ASCII

北城余情 提交于 2019-12-29 07:32:06
问题 Is there a character set other than EBCDIC that is not a superset of 7-bit ASCII? 回答1: Yes. JIS X 0208 is not a superset of ASCII. Some versions of this standard include most of the ASCII characters, but not all of them. A related fact is that a file encoded with UTF-16 or UTF-32 is not byte-equivalent to an ASCII file of the same characters, but since those are not character sets, and since Unicode is certainly a superset of ASCII, they do not qualify as answers to your question. 回答2: There

Can I use iconv to convert multi-byte smart quotes to extended ASCII smart quotes?

大兔子大兔子 提交于 2019-12-29 06:56:46
问题 I have some UTF-8 content that includes multi-byte smart quote characters. I've found that this code will easily convert those characters to ASCII straight quotes (ASCII code 34): $content = iconv("UTF-8", "ASCII//TRANSLIT", $content); OR $content = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $content); However, I'd rather convert these to extended ASCII smart quotes (ASCII codes 147 and 148 in Latin 1 encoding). Does anyone know how to do this? 回答1: You're looking for CP-1252 which contains

Can I use iconv to convert multi-byte smart quotes to extended ASCII smart quotes?

為{幸葍}努か 提交于 2019-12-29 06:56:29
问题 I have some UTF-8 content that includes multi-byte smart quote characters. I've found that this code will easily convert those characters to ASCII straight quotes (ASCII code 34): $content = iconv("UTF-8", "ASCII//TRANSLIT", $content); OR $content = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $content); However, I'd rather convert these to extended ASCII smart quotes (ASCII codes 147 and 148 in Latin 1 encoding). Does anyone know how to do this? 回答1: You're looking for CP-1252 which contains

Getting an UTF-8 response with httpclient in Windows Store apps

余生颓废 提交于 2019-12-29 06:46:29
问题 I'm building a Windows Store app, but I'm stuck at getting a UTF-8 response from an API. This is the code: using (HttpClient client = new HttpClient()) { Uri url = new Uri(BaseUrl + "/me/lists"); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, url); request.Headers.Add("Accept", "application/json"); HttpResponseMessage response = await client.SendRequestAsync(request); response.EnsureSuccessStatusCode(); string responseString = await response.Content.ReadAsStringAsync();

Java App : Unable to read iso-8859-1 encoded file correctly

好久不见. 提交于 2019-12-29 06:22:09
问题 I have a file which is encoded as iso-8859-1, and contains characters such as ô . I am reading this file with java code, something like: File in = new File("myfile.csv"); InputStream fr = new FileInputStream(in); byte[] buffer = new byte[4096]; while (true) { int byteCount = fr.read(buffer, 0, buffer.length); if (byteCount <= 0) { break; } String s = new String(buffer, 0, byteCount,"ISO-8859-1"); System.out.println(s); } However the ô character is always garbled, usually printing as a ? . I

UTF-8 encoidng issue when exporting csv file , JavaScript

社会主义新天地 提交于 2019-12-29 05:20:05
问题 I use the below function to export an array to a csv files in JavaScript, but the Chinese characters become messy code with Microsoft Excel 2013 in Windows7. I open the exported file with a notepad but it displays finely. function arrayToCSVConvertor(arrData, reportTitle) { var CSV=''; arrData.forEach(function(infoArray, index){ var dataString = infoArray.join(","); dataString= dataString.split('\n').join(';'); CSV += dataString+ "\n"; }); if (CSV == '') { alert("Invalid data"); return; } /