character-encoding

What is an example for non unicode character set for -Dfile.encoding=?

試著忘記壹切 提交于 2021-01-29 09:29:54
问题 I have a JVM. where character set as "-Dfile.encoding=UTF-8" . This is how UTF-8 is set. I would want to set it to a non Unicode character set. Is there an example/value for non unicode character set so that I can set to -Dfile.encoding= ? 回答1: [ TLDR => Application encoding a confusing issue, but this document from Oracle should help . ] First a few important general points about specifying the encoding by setting the System Property file.encoding at run time: It's use is not formally

How to read multiple known file encodings

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 08:32:01
问题 I've been searching the web for a solution to address reading files with different encodings and I've found many instances of "it's impossible to tell what encoding a file is" (so if anyone is reading this and has a link I would appreciate it). However, the problem I was dealing with was a bit more focused than "open any file encoding" but rather open a set of known encodings. I am by no means an expert at this topic but I thought I would post my solution in case anyone ran into this issue.

How to change an entire website's files' character encoding to UTF-8?

孤者浪人 提交于 2021-01-29 07:57:58
问题 How can I change all of my php/css/js files to utf character encoding? I can't get it to validate otherwise. 回答1: Have you tried the .htaccess option "AddCharset". It should work on the parent directory of where the .htaccess file is located plus all sub directories. AddCharset UTF-8 .php http://www.w3.org/International/questions/qa-htaccess-charset 回答2: You haven't said what encoding the files are in at the moment, or what operating system you are using. On my Ubuntu system, I have a command

Incorrect string value: '\xE2\x80\xAF(fo…' for column 'description' at row 1 Error: INSERT INTO my_table_name

喜你入骨 提交于 2021-01-29 05:37:00
问题 Sometimes, when the text is copy pasted from a third website in my form based application (in the textarea) the data don't get inserted in database , instead throw this below error. Incorrect string value: '\xE2\x80\xAF(fo...' for column 'my_column_name' at row 1 Error: INSERT INTO my_table_name I tried the below query in mysql workbench to solve this issue. ALTER TABLE my_database_name.my_table CONVERT TO CHARACTER SET utf8 But I am getting the below error from the database. Error Code: 1118

Decoding “=C3=A4” in a string

不想你离开。 提交于 2021-01-29 04:44:11
问题 I tried a lot of different things to get my string correctly displayed but I can't make it work. That's the string: f=C3=A4hrt (German word: fährt) My file is encoded in utf-8, the file is loaded within Joomla. I tried both $geschichte->inhalt = utf8_encode($geschichte->inhalt); and $geschichte->inhalt = mb_convert_encoding($geschichte->inhalt, "UTF-8"); but nothing works. I hope someone can help me... 回答1: This encoding has nothing to do with UTF-8 or such, it looks like quoted printable

Open a word document and specify encoding with PowerShell

微笑、不失礼 提交于 2021-01-29 02:52:48
问题 I'm trying to tell PowerShell to open a text file and choose a certain encoding option. By default, when opening this text file in Word manually, it tries to open it with Japanese encoding and so doesn't show certain characters correctly. I've tried lots of different things but nothing works so I'm totally stuck. This text file, amongst others, needs to be converted to PDF on a daily basis. My current script is as follows: $wdFormatPDF = 17 $word = New-Object -ComObject Word.Application $word

Open a word document and specify encoding with PowerShell

谁说胖子不能爱 提交于 2021-01-29 02:43:52
问题 I'm trying to tell PowerShell to open a text file and choose a certain encoding option. By default, when opening this text file in Word manually, it tries to open it with Japanese encoding and so doesn't show certain characters correctly. I've tried lots of different things but nothing works so I'm totally stuck. This text file, amongst others, needs to be converted to PDF on a daily basis. My current script is as follows: $wdFormatPDF = 17 $word = New-Object -ComObject Word.Application $word

R greater than or equal to character converts to equal sign

别来无恙 提交于 2021-01-28 20:11:29
问题 I have imported an Excel (xlsx) file using the readxl package in R . One of the columns, labeldata , that is imported into R contains labels for other data contained in the file, so it consists of character data such as ≥65 years old . When I print this labeldata to the console the value for "greater than or equal to 65 years old" is properly displayed as ≥65 years old . However, when I try to combine this column with other columns (using cbind or other methods), the greater than or equal to

Using Swift, how do you re-encode then decode a String like this short script in Python?

穿精又带淫゛_ 提交于 2021-01-28 19:36:34
问题 XKCD has some issues with their API and weird encoding issues. Minor encoding issue with xkcd alt texts in chat The solution (in Python) is to encode it as latin1 then decode as utf8, but how do I do this in Swift? Test string: "Be careful\u00e2\u0080\u0094it's breeding season" Expected output: Be careful—it's breeding season Python (from above link): import json a = '''"Be careful\u00e2\u0080\u0094it's breeding season"''' print(json.loads(a).encode('latin1').decode('utf8')) How is this done

Converting character encoding within c++

瘦欲@ 提交于 2021-01-28 12:34:30
问题 I have a website which allows users to input usernames. The problem here is that the code in c++ assumes the browser encoding is Western Europe and converts the string received from the username text box into unicode to compare with string stored within the databasse. with the right browser encoding set the character úser is recieved as %FAser and coverted properly to úser within the program however with the browser settings set to UTF-8 the string is recieved as %C3%BAser and then converted