Questions tagged [file-encodings]

In communications and Information processing, file-encoding is the process by which information from a source is converted into symbols to be communicated.The tag file-encoding refers to programming related questions belongs to various encoding schemes for file formats.

Wiki:

Encoding of a file is achieved by converting information into another form of representation. The information can be then converted in any file format. The encoding of a file must follow the rules of file format specifications. Every known file format has its own header structure and while writing a file, encoder must obey rules of file header format.

Example: Analog data which comes through a device sensor or a camera can be converted into digital data which later can be written in a file with image formats like .BMP .JPG .PNG TIFF GIF etc. The BMP or Bitmap file format is a common and simplest kind of image format which can be encoded with various encoding schemes like Monochrome encoding, 24-Bit encoding etc. and This must be done so that the Decoder applications, browsers and Image viewers can decode the encoded file formats.

Usage:

The tag file-encodings can be used for file encoding related programming questions. The tag should not be confused with related programming questions.

135 questions
2
votes
2 answers

Removing non-printable character

Okay, so I've been bashing my head against the table over this one. I am importing an XML file that was exported by Indesign. This parses it and creates a file based on the input. (I'm building a JS application with Node) This file looks good in my…
Rob
  • 4,927
  • 4
  • 26
  • 41
2
votes
1 answer

Changing File Encoding in Visual Studio 2015

I just installed Visual Studio 2015 Professional (Version 14.0.23107.0 D14REL). I created a simple MFC project and when I tried to change file encoding, Visual Studio just shows a few encoding types. Unicode (UTF-8 with signature) - Codepage…
KLIM
  • 21
  • 1
  • 4
2
votes
0 answers

Wrong encoding when pasting into emacs

I'm trying to paste accented characters (eg: á, é, í) into Emacs but here's what I get: When I paste into some other editor, like Vim, it works fine. I already tried putting this in my init.el (setq utf-translate-cjk-mode…
Jesse
  • 1,449
  • 2
  • 15
  • 20
2
votes
3 answers

Android question mark in TextView?

I have a problem with accented characters in a TextView in an Android activity. The rendering shows me question marks instead chars "è" and "à". The flow is: Get a midi file from web resource --> extract lyrics --> put lyrics in a TextView. I don't…
2
votes
1 answer

Files with mixed encoding - Python

I have some files with mixed encodings, I believe UTF-8 and UTF-16LE. It's a mix of some English letters but mostly Chinese characters. Goal: use Python to convert the file all to UTF-8. '\n' ought to be a newline. The answer to a similar question…
DevinRB
  • 107
  • 2
  • 8
2
votes
2 answers

What's the encoding in which the file is saved when I use open(filename) in Python or fopen(filename) in C?

Runtime Environment: Python 2.7, Windows 7 NOTE:I am talking about the encoding of the file generated by the PYTHON source code(NOT talking about the PYTHON source file's encoding), the encoding declared at the top of the PYTHON source file DID…
imsrch
  • 1,152
  • 2
  • 11
  • 24
1
vote
4 answers

Charset of Java source file and failing test

First, I'd like to say that I've spent a lot of time searching for an explanation/solution. I've found hints of the problem, but no way to resolve my particular issue. Hence the post on a topic that seems to have been beaten to death in at least…
torngat
  • 635
  • 1
  • 5
  • 16
1
vote
3 answers

Detect if file contains text

Possible Duplicate: How can I determine if a file is binary or text in c#? C# - Check if File is Text Based To better understand multi threading and asynchronous tasks, I wrote a simple application in C# to count the total number of lines of code…
Ayush
  • 41,754
  • 51
  • 164
  • 239
1
vote
1 answer

PerlIO in Windows PowerShell and CMD.exe

Apparently, a Perl script I have results in two different output files depending on if I run it under Windows PowerShell, or cmd.exe. The script can be found at the bottom of this question. The file handle is opened with IO::File, I believe that…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
1
vote
1 answer

Loop Through File Extensions, Looking for Non-ASCII Characters - Python

I wrote a little Python program that looks though a directory (and its subdirectories) for files that contain non-ASCII characters. I want to improve it. I know that certain files in this "directory" may be ZIP, DTA/OUT, OMX, SFD/SF3, etc... files…
nicorellius
  • 3,715
  • 4
  • 48
  • 79
1
vote
1 answer

How to output file in the right encoding by PowerShell?

I'm trying to output my log file to disk in PowerShell, but i get wrong file content. Info as follow: Windows 10 Enterprise LTSC 21H2 PowerShell Version: Name Value ---- ----- PSVersion …
Yatung Yü
  • 11
  • 2
1
vote
1 answer

why set fileencoding=cp936 no use?

I create a file, execute the following command: :set fileencoding result is : fileencoding=cp936 I edit and then close the file. I reopen the file and execute the following command: :set fileencoding result is : fileencoding=utf-8 The…
Da Wang
  • 100
  • 7
1
vote
1 answer

pandas read_json returns ValueError: Expected object or value

Using pandas:1.4.2, I have file.json file with content as list [ { "col1":"v1", "col2":"v2" }, ... { "col1":"v3", "col2":"v4" } ] Read file as pd.read_json('file.json', orient='records') Gives ValueError: Expected object…
holmen
  • 75
  • 5
1
vote
0 answers

cat file.pyz | python fails, why?

I want to execute a pyz file over SSH in this way: cat test.pyz | ssh -M user@somehost python This is the current output: File "", line 1 PKimport sys ^ SyntaxError: invalid syntax After some digging, I discovered that if I try: …
subzero
  • 3,420
  • 5
  • 31
  • 40
1
vote
1 answer

Read non alphabetic character using pandas from excel

I am trying to read this file using pandas in UTF-8 encoding. English alphabetic characters are read properly but those characters which are not English alphabet are not read properly. I tried reading by changing encoding from utf8 to cp1252, ASCII…
1 2
3
8 9