character-encoding

PostgreSQL: character with byte sequence 0xc2 0x81 in encoding “UTF8” has no equivalent in encoding “WIN1252”

不打扰是莪最后的温柔 提交于 2020-06-22 11:39:50
问题 Getting the below exception while executing SELECT query for a particular row on that table ERROR: character with byte sequence 0xc2 0x81 in encoding "UTF8" has no equivalent in encoding "WIN1252" One of the column in that row contains Japanese character which has been encoded with UTF-8 and inserted into it. Is there any fix for this issue? 回答1: You should know what encoding is used in your database. SHOW server_encoding; When you connect to your database you can specify what encoding should

Using iconv with WCHAR_T on Linux

扶醉桌前 提交于 2020-06-01 06:20:06
问题 I have the following code on Linux:- rc = iconv_open("WCHAR_T", SourceCode); prior to using iconv to convert the data into a wide character string ( wchar_t ). I am trying to understand what it achieves in order to port it to a platform where the option on parameter 1, "WCHAR_T" , does not exist. This leads to sub-questions such as: Is there a single representation of wchar_t on Linux? What codepage does this use? I imagine maybe UTF-32 Does it rely on any locale settings to achieve this? I'm

How to double encodeURIComponent in javascript?

别等时光非礼了梦想. 提交于 2020-06-01 03:11:09
问题 In my web app, I use a mailto link to open the outlook 2007. I also insert a url into the body. The problem is I need the whole url to be a hyperlink. If there is any spaces, then the hyperlink breaks, or even if there is any special characters like if it ends with a close parenthesizes the character wont be included in the hyperlink, so the link breaks. What I tried was using encodeURIComponent on the link, which url encodes it, but the issue is that in outlook, it will automatically decode

Rails 3: Change charset and collation of an existing mysql database

◇◆丶佛笑我妖孽 提交于 2020-05-29 09:05:18
问题 Is it possible to change the charset and collation of an existing Mysql database using Rails migrations or other options ?! What's the best way to initially configure database charset & collation ?! 回答1: For latest version of Rails you can use this gist: Change charset and collation of an existing mysql Modified from here: 回答2: Native query could be executed in rails migration: def self.up execute "ALTER DATABASE `#{ActiveRecord::Base.connection.current_database}` CHARACTER SET charset_here

Download a file with name including special characters from FTP server in C#

陌路散爱 提交于 2020-05-27 09:17:10
问题 I tried to download files, but all files with special character cannot be recognized. Other files can be downloaded, while file named asdf#code@.pdf cannot be downloaded. Error: The remote server returned an error: (550) File unavailable (e.g., file not found, no access). In local, the file with correct name is created, but it is empty. The same thing happens on JPG files with # inside of the file names. how can I let them be recognized? //Download the file from remote path on FTP to local

Download a file with name including special characters from FTP server in C#

岁酱吖の 提交于 2020-05-27 09:16:30
问题 I tried to download files, but all files with special character cannot be recognized. Other files can be downloaded, while file named asdf#code@.pdf cannot be downloaded. Error: The remote server returned an error: (550) File unavailable (e.g., file not found, no access). In local, the file with correct name is created, but it is empty. The same thing happens on JPG files with # inside of the file names. how can I let them be recognized? //Download the file from remote path on FTP to local

Does C++ support converting between character encodings other than UTF-8, UTF-16, and UTF-32?

浪子不回头ぞ 提交于 2020-05-25 08:01:12
问题 I understand that std::codecvt<char16_t, char> in C++11 performs conversion between UTF-16 and UTF-8, and std::codecvt<char32_t, char> performs conversion between UTF-32 and UTF-8. Is it possible to convert between, say, UTF-8 and ISO 8859-1? Consider: const char* s = "\u00C0"; If I print this string and my terminal's encoding is set to UTF-8, I will see the character À . If I set my terminal's encoding to ISO 8859-1, however, printing that string will not print out the desired character. How

Does C++ support converting between character encodings other than UTF-8, UTF-16, and UTF-32?

ぃ、小莉子 提交于 2020-05-25 08:01:11
问题 I understand that std::codecvt<char16_t, char> in C++11 performs conversion between UTF-16 and UTF-8, and std::codecvt<char32_t, char> performs conversion between UTF-32 and UTF-8. Is it possible to convert between, say, UTF-8 and ISO 8859-1? Consider: const char* s = "\u00C0"; If I print this string and my terminal's encoding is set to UTF-8, I will see the character À . If I set my terminal's encoding to ISO 8859-1, however, printing that string will not print out the desired character. How

How do you convert unicode string to escapes in bash? [closed]

我与影子孤独终老i 提交于 2020-05-24 05:38:31
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I need a tool that will translate the unicode string into escape characters like \u0230. For example, echo ãçé | convert-unicode-tool \u00e3\u00e7\u00e9 回答1: All bash method - echo ãçé | while read -n 1 u do [[ -n "$u" ]] && printf '\\u%04x' "'$u" done That leading apostrophe is a

problems reading correctly a csv due to UnicodeDecodeError in Python3

不问归期 提交于 2020-05-17 14:47:07
问题 I create a csv file in wich I put some lyrics of songs, using this: with io.open('songs.csv', 'a+',encoding='utf-8') as file: writer = csv.writer(file , dialect='excel') writer.writerow(input_row) the csv ( opened with excel) is quite strange - I don't know how to upload files here so please sorry for the pic. - As you can see, the delimiters for the csv are commas, (the columns should be Artist, Album, Title, Lyric ) I noticed that I had some spanish and italian lyrics, and characters like