Questions tagged [utf-8]

UTF-8 is a character encoding that describes each Unicode code point using a byte sequence of one to four bytes. It is backwards-compatible with ASCII while still supporting representation of all Unicode code points.

UTF-8 is a that can describe the set of code points in byte sequences of one to four bytes.

UTF-8 is the most widely used character encoding, and is recommended for use on the Internet. It is the standard character encoding on and other recent -like operating systems. It was designed to be backwards-compatible with while still supporting representation of all Unicode code points.

The algorithm for encoding code points in UTF-8 is described in RFC 3629.

Related tags

22178 questions
8
votes
1 answer

How can I convert "Western (Mac OS Roman)" formatted text to UTF-8 with PHP?

I have files being exported by Excel for Mac 2011 VBA in Western (Mac OS Roman) as shown here: I haven't been successful in getting Excel for Mac VBA to export directly to UTF-8 so I want to convert these files with PHP before I save them to MySQL,…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
8
votes
0 answers

How to decode value in redis cli or shell script

I've written redis-cli bash script to process all key and value for bulk retrieval but values are not printing as expected. When I give my key in redis-cli its printing with all special characters: My Key and output from redis-cli redis-cli MGET…
learn java
  • 231
  • 3
  • 14
8
votes
2 answers

python3 default encoding UnicodeDecodeError ascii using apache WSGI

import locale prefered_encoding = locale.getpreferredencoding() prefered_encoding 'ANSI_X3.4-1968' I'm using a framework called inginious and it's using web.py to render its template. web.template.render(os.path.join(root_path, dir_path), …
WebQube
  • 8,510
  • 12
  • 51
  • 93
8
votes
2 answers

How to force UTF-8 in node js with exec process?

I know the solution is very simple, but it's an hour I'm banging my head. In Windows 10, if i launch the command "dir", i got this result: Il volume nell'unità D non ha etichetta. in Node js i try to exec the dir command in this way: var child =…
Janka
  • 1,908
  • 5
  • 20
  • 41
8
votes
4 answers

Golang truncate strings with special characters without corrupting data

I am trying to write a function to truncate strings with special characters in golang. One example is below "H㐀〾▓朗퐭텟şüöžåйкл¤" However I am doing it based on the number of characters allowed and cutting it in the middle. This results in data getting…
Sakib
  • 1,503
  • 4
  • 26
  • 39
8
votes
0 answers

What does `utf-8` charset change in a `multipart/form-data` HTTP request?

In an attempt to upload a binary file to a web server, I observed that by setting the Content-Type header to a value with charset="utf-8" present, the POST request data integrity fails. Chrome seems to omit all charset attributes in both the header…
David Refoua
  • 3,476
  • 3
  • 31
  • 55
8
votes
1 answer

Are XLSX files UTF-8 encoded by definition?

I'm trying to read in XLSX files with PHP. Using gneustaetter/XLSXReader to be exact. However, these XLSX-files are generated by different companies, using different software. So I wanted to check if they have the right encoding and always just…
Marco
  • 550
  • 2
  • 6
  • 22
8
votes
3 answers

How to convert a single-byte const char* to a UTF-8 encoding

I have a function which requires me to pass a UTF-8 string pointed by a char*, and I have the char pointer to a single-byte string. How can I convert the string to UTF-8 encoding in C++? Is there any code I can use to do this? Thanks!
Luca Carlon
  • 9,546
  • 13
  • 59
  • 91
8
votes
4 answers

Why does locale.getpreferredencoding() return 'ANSI_X3.4-1968' instead of 'UTF-8'?

Whenever I try to read UTF-8 encoded text files, using open(file_name, encoding='utf-8'), I always get an error saying ASCII codec can't decode some characters (eg. when using for line in f: print(line)) Python 3.5.3 (default, Jan 19 2017,…
jm33_m0
  • 595
  • 2
  • 9
  • 17
8
votes
1 answer

Send up arrow `↑` character to iPhone with SMS using VBA and a CDO mail object

I need to send an up arrow ↑ to an iPhone with SMS using VBA and a CDO mail object. My attempts are as follows: Unicode: subj = ChrW(8593) & " Up " & ChrW(8593) HTML: subj = "↑ Up ↑" Both of the above methods result in the iPhone…
user4039065
8
votes
2 answers

Perl: utf8::decode vs. Encode::decode

I am having some interesting results trying to discern the differences between using Encode::decode("utf8", $var) and utf8::decode($var). I've already discovered that calling the former multiple times on a variable will eventually result in an…
Matt
  • 133
  • 1
  • 1
  • 5
8
votes
1 answer

How to read UTF-8 encoded text file using std::ifstream?

I'm having a hard time to parse an xml file. The file was saved with UTF-8 Encoding. Normal ASCII are read correctly, but Korean characters are not. So I made a simple program to read a UTF-8 text file and print the content. Text…
JaeJun LEE
  • 1,234
  • 3
  • 11
  • 27
8
votes
4 answers

I need dump table from SQL Server to csv in utf-8

This works but not in utf-8: sqlcmd -S Server -d DB -E -s, -W -i "C:\Localdata\test.sql" | findstr /V /C:"-" /B > "C:\Localdata\Test.csv" Would anybody like to help fix this into utf-8?
JoezCodes
  • 157
  • 2
  • 15
8
votes
4 answers

How do I set pageEncoding for all my JSPs without touching each JSP file?

I’m using Java 6, JBoss 7.1.3 and Spring 3.2.11.RELEASE. Despite the fact that we set this in our application context
Dave
  • 15,639
  • 133
  • 442
  • 830
8
votes
1 answer

python bytes(some_string, 'UTF-8') and str(some_string, 'UTF-8')

I want to adapt a code written for python3 to python2.7 while doing so I am getting errors because of the this two bytes(some_string, 'UTF-8') and str(some_string, 'UTF-8') My Question: Is following a correct way to adapt str(some_string,…
rahulk9
  • 795
  • 3
  • 10
  • 20