character-encoding

broken UTF-8 String ruby

半腔热情 提交于 2020-01-17 03:22:06
问题 While reading a file I get broken UTF-8 String error whenever I have the following in my file través if I change it to normal e then it works. Whats the way to fix this? error only happens if I do line.lstrp or any other function. Just printing the lines is ok. problem even happens when I try to match the string with regex. 回答1: Obviously your file is not UTF-8 encoded. So, you should either take care of that (save your file using UTF-8), or tell Ruby that your strings aren't going to be UTF

PowerShell EncodedCommand Failing

Deadly 提交于 2020-01-17 01:29:05
问题 I'm trying to pop up a simple message box using Powershell's -EncodedCommand flag, but it keeps failing. I've tried Googling for the last few hours, but can't seem to get this working. It almost looks like an encoding error, but I'm using regular UTF-8 with standard ASCII backwards-compatible characters. The command that keeps failing: Powershell.exe -EncodedCommand

PHP Uploaded file name: Japanese character encoding

守給你的承諾、 提交于 2020-01-16 23:42:36
问题 When uploading a file with a japanese name, some characters are creating problem. On a windows system, I want to save the name of the file as-uploaded. So I have to use mb_convert_encoding($name, "SJIS", "AUTO"); which works fine most of the cases. Though, some characters like ① as in 0423図表① totally disappear at the end. It seems that when uploaded the name of the file is already "wrong": it looks like "0423å³è¡¨â .pptx" in UTF-8 and if I change the header charset with header('Content-Type:

R encoding UTF-8: U+0080-U+009F

房东的猫 提交于 2020-01-16 18:01:48
问题 I am struggling with some encoding issues. I have many textfiles that contain rows in the following format: https://dl.dropboxusercontent.com/u/94114397/example.txt According to Notepad++, these are all encoded in UTF-8 and most non-ASCII characters are displayed correctly, as you can see in lines 1 and 2. However, I have problems with some characters that seem to be wrongly interpreted(?). In my example file, this the case in line 3 in the word "Lakuic", where there should be an "š" between

R encoding UTF-8: U+0080-U+009F

元气小坏坏 提交于 2020-01-16 18:01:11
问题 I am struggling with some encoding issues. I have many textfiles that contain rows in the following format: https://dl.dropboxusercontent.com/u/94114397/example.txt According to Notepad++, these are all encoded in UTF-8 and most non-ASCII characters are displayed correctly, as you can see in lines 1 and 2. However, I have problems with some characters that seem to be wrongly interpreted(?). In my example file, this the case in line 3 in the word "Lakuic", where there should be an "š" between

Question mark (char 57399) added to HTML element text

陌路散爱 提交于 2020-01-16 10:36:10
问题 I've come across a problem that seems really weird to me. I'm scraping a website using Jsoup: Elements names = doc.select(".Mod.Thm-inherit").select("h3"); for (Element e : names) { System.out.println(e.text()); } My output is (Fantasy hockey team names, names changed for simplicity): Team One ? Team Two ? Team Three ? Team Four ? Team Five ? //etc Now the actual team names don't have the extra space or question mark. Thinking I could just replace it, I tried: String str = e.text().replaceAll

nvarchar column result with question marks

拥有回忆 提交于 2020-01-16 09:59:08
问题 I'm trying to update the queue item and retrieve it's column text content. the problem is that special signs such as Hebrew chars resulted in question marks: ???? I can see the text perfectly fine by making direct SELECT clause (within the sql management studio ): Message's column ------- היי hey When i try to retrieve the data it get scrambled : היי ---> ??? (Not OK) hey ---> hey (OK) My table: CREATE TABLE [dbo].[MyQueue]( [Message] [nvarchar](1000) NOT NULL --some additional columns ) This

How can I store bytes in Oracle Varchar2, and have ASCII treated as text

巧了我就是萌 提交于 2020-01-16 09:09:11
问题 How can I have bytes stored in a Varchar2, and have it treated "normally" as text when it is ASCII for example? (Like in queries). If not possible, where is the limitation? I know the column is defined with a character sets, so if it is ANSI for example, what kind of 1-byte values can I not put there? Are there "better" solutions than ANSI for 1-byte character sets? 回答1: You have to encode bytes into text. You can use rawtohex function or utl_encode package. For displaying characters you have

Unexpected character when downloading file client side from a servlet

北城以北 提交于 2020-01-15 10:57:28
问题 I create a servlet to download a specific text which the client post with a form before (in a textarea)... The form in the client side is nothing speciel: form = new FormPanel(); form.setMethod(FormPanel.METHOD_POST); form.setAction(GWT.getModuleBaseURL() + "services/export"); exportButton = new Button(resource.SUBMENU_Export(), new ClickHandler() { public void onClick(ClickEvent event) { form.submit(); } }); And this is the code at the server side (serlvet): package com.server.servlet;

Character encoding errors with .NET Core on Linux

青春壹個敷衍的年華 提交于 2020-01-15 09:21:05
问题 This has been driving me batty for days, and I've finally got it down to a simple, reproducible issue. I have a NUnit test project, which is .NET Core 2.1. It references a library (let's call it "Core") which is .NET Standard 2.0. In my test project: [TestCase(true, false)] [TestCase(false, false)] [TestCase(false, true)] public void ShouldStartWith(bool useInternal, bool passStartsWith) { var result = useInternal ? StartsWithQ("¿Que?") : StringUtilities.StartsWithQ("¿Que?", passStartsWith ?