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
77
votes
11 answers

StreamWriter and UTF-8 Byte Order Marks

I'm having an issue with StreamWriter and Byte Order Marks. The documentation seems to state that the Encoding.UTF8 encoding has byte order marks enabled but when files are being written some have the marks while other don't. I'm creating the…
Kevin
  • 779
  • 1
  • 5
  • 3
46
votes
4 answers

How can I be sure of the file encoding?

I have a PHP file that I created with VIM, but I'm not sure which is its encoding. When I use the terminal and check the encoding with the command file -bi foo (My operating system is Ubuntu 11.04) it gives me the next result: text/html;…
ecantu
  • 713
  • 2
  • 7
  • 11
36
votes
6 answers

File.listFiles() mangles unicode names with JDK 6 (Unicode Normalization issues)

I'm struggling with a strange file name encoding issue when listing directory contents in Java 6 on both OS X and Linux: the File.listFiles() and related methods seem to return file names in a different encoding than the rest of the system. Note…
30
votes
1 answer

PowerShell out-file: prevent encoding changes

I'm currently working on some search and replace operation that I'm trying to automate using powershell. Unfortunately I recognized yesterday that we've different file encodings in our codebase (UTF8 and ASCII). Because we're doing these search and…
Pete
  • 539
  • 1
  • 5
  • 10
23
votes
1 answer

Powershell: Get default system encoding

The powershell cmdlet out-file has the switch -encoding witch you can set to default. This default value will use the encoding of the system's current ANSI code page. My question is: How can I get the name of this default encoding that out-file will…
Ocaso Protal
  • 19,362
  • 8
  • 76
  • 83
14
votes
4 answers

Why is R reading UTF-8 header as text?

I saved an Excel table as text (*.txt). Unfortunately, Excel don't let me choose the encoding. So I need to open it in Notepad (which opens as ANSI) and save it as UTF-8. Then, when I read it in R: data <-…
Rodrigo
  • 4,706
  • 6
  • 51
  • 94
12
votes
3 answers

Java Charset problem on linux

problem: I have a string containing special characters which i convert to bytes and vice versa..the conversion works properly on windows but on linux the special character is not converted properly.the default charset on linux is UTF-8 as seen with…
Inv3r53
  • 2,929
  • 3
  • 25
  • 37
12
votes
5 answers

How can I set the default file format in the Delphi IDE to UTF8?

Delphi 2009 sets the default file format for new source code files to ANSI, this makes the source code platform-dependent. Even for a new XSD file created in the IDE, which by default starts with this line
mjn
  • 36,362
  • 28
  • 176
  • 378
8
votes
4 answers

Converting Mac Roman character to equivalent UTF-8

I have been given some HTML files that use the Mac OS Roman file encoding. The files have French text, but in an editor many of the diacritical chars look strange (i.e. non French) Si cette option est sÈlectionnÈe, tentera de communiquer…
btschumy
  • 1,435
  • 1
  • 18
  • 35
7
votes
2 answers

How to write and read printable ASCII characters to/from UTF-8 encoding file?

I want to write to a file with UTF-8 encoding containing the character 10001100 which is Œ the Latin capital ligature OE in extended ASCII table, zz <- file("c:/testbin", "wb") writeBin("10001100",zz) close(zz) When I open the file with…
showkey
  • 482
  • 42
  • 140
  • 295
7
votes
2 answers

Is there way to check charset encoding of .txt file with Java?

Is there way to check is text file (.txt) encoded with Unicode or UTF-8 with Java?
Zookey
  • 2,637
  • 13
  • 46
  • 80
6
votes
1 answer

NodeJS & Gulp Streams & Vinyl File Objects- Gulp Wrapper for NPM package producing incorrect output

Goal I am currently trying to write a Gulp wrapper for NPM Flat that can be easily used in Gulp tasks. I feel this would be useful to the Node community and also accomplish my goal. The repository is here for everyone to view , contribute to, play…
daniel.caspers
  • 1,660
  • 1
  • 18
  • 22
5
votes
0 answers

Visual Studio Code: setting file encoding by folder

In Visual Studio Code (Community version 1.17.2), I have configured file encoding in my Working Settings (settings.json) like that: "files.encoding": "utf8" Nevertheless, inside a specific folder in my Working Space, I need to have some scripts…
framontb
  • 1,817
  • 1
  • 15
  • 33
5
votes
1 answer

What does -Dfile.encoding = UTF-8 do in JAVA_OPTIONS

Any idea what does -Dfile.encoding=UTF-8 in JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile.encoding=UTF-8" do? I have this option in my jetty server configuration. If i dont have it, what might be consequence?
Nilotpal
  • 3,237
  • 4
  • 34
  • 56
5
votes
1 answer

How do I set file.encoding for a junit test in ant?

I'm not quite done with file.encoding and ant. How do I set the file.encoding for junit tests in ant? The junit ant task doesn't support the encoding attribute like the javac task does. I've tried running «ant -Dfile.encoding=UTF-8» and…
neu242
  • 15,796
  • 20
  • 79
  • 114
1
2 3
8 9