Skip to main content

All Questions

Tagged with
0 votes
0 answers
43 views

How to detect and print the encoding of a list of .sql files in a particular directory?

I have a list of .sql files that need to checked for their encoding before i make changes to them. They are either in utf 8 or utf 16. How can I make some changes to my code so that it enter code ...
Vemala Valas's user avatar
0 votes
0 answers
489 views

How to Read Contents of an Audio File to a string

I'm working on an app that needs to write the contents of a music file to StreamWriter which is used to create a copy of the file. My first attempt resulted in a file that couldn't be played. ...
Alwaysdeadfred's user avatar
0 votes
1 answer
327 views

StreamWriter is changing some Japanese chars to some strange chars in C#

I have an input string displayName which is in base64 format, used for comparison. displayName:: Rmlyc3ROYW1lW0FCQ0Q65LqL5qWt5qeL6YCg5pS56Z2p6YOoIOizvOiyt+alreWLmeS8geeUu+OD ...
RDN's user avatar
  • 35
0 votes
1 answer
134 views

Reading and writing binary data from one to another file

I'm reading a binary file and writing to another file in CP 437 format by skipping few lines. But the output file size is increased than the original file and also data is corrupted. Any help to ...
Denesh Kumar's user avatar
1 vote
2 answers
16k views

C# Write to file using StreamWriter with ANSI encoding doesn't work

I want to write to text file with ANSI encoding. Code looks like below: string text = "abc123"; string filePath = "C:\\Data\\MyFile.csv"; using (StreamWriter sw = new StreamWriter(File.Open(...
mike_pl's user avatar
  • 121
0 votes
1 answer
688 views

StreamWriter writing 2 characters per character over Ascii value 128. How to write just 1 character?

I am re-writing some legacy software. This legacy software creates files using bcp using data from sql server. The new software has replaced the bcp method and uses StreamWriter in a C# app to ...
Craig's user avatar
  • 879
0 votes
1 answer
136 views

Downloading a simple space delimited file with C# yields garbage characters

When trying to initiate a download of a fixed width file in C# and opening the downloaded file with notepad the content comes out complete gibberish. See below as an example. ????????\@@@@@@@@@@@@@@@@@...
gh0st's user avatar
  • 1,692
0 votes
2 answers
2k views

Character Encoding not working for Japanese ,Chinese and Korean

I have Unicode characters for all the European countries and for a few Asian countries like Japan, China, Korean. All the Unicodes are working fine for European countries except for Japan, China, ...
Subham's user avatar
  • 450
0 votes
1 answer
58 views

Special Character Count issue in Client System

We have an exe which extracts data from various tables in our database and write them to a text/csv file. This file is subsequently fetch by client system for internal purposes. While loading this ...
sobsinha's user avatar
  • 111
5 votes
2 answers
3k views

What is the right CSV encoding for c# to open with Excel?

I write a CSV with my C# CSVWriter based on a StreamWriter. In my data I have a lot of special characters like "Bávaro". So when I use UTF-8 or ASCII to encode my CSV I can't get the "á" but I can ...
PassionateDeveloper's user avatar
0 votes
1 answer
2k views

VB Streamwriter set to ISO-8859-1 but file get UTF8-Without Bom encoding

I have a problem i set the streawriter to write ISO-8853-1 but the file gets utf8 encoding. See code below: when declaring str i set it to iso-8853-1 and when i check the output files encoding i get ...
Rownie's user avatar
  • 3
2 votes
1 answer
5k views

Saving CSV file with degree symbol and ASCII encoded

I have string variable txt. It contains "°" degree symbol. I would like to save string into CSV file ASCII encoded. I use the procedure below But the "°" symbol is converted to "?". Do you have any ...
Tomas Paul's user avatar
0 votes
1 answer
2k views

Write to File without Encoding

I'm getting JSON from a webservice with encoded characters: \u201c, etc. As I'm parsing it works perfectly: double quotes inside texts have the encoded character value, while control double quotes are ...
Matheus Simon's user avatar
-3 votes
1 answer
2k views

Why StreamWriter writes text to file with using UTF-8 without BOM? [closed]

Find out that StreamWriter uses UTF-8 without BOM by default. I understand using UTF-8, but why without BOM? http://referencesource.microsoft.com/#mscorlib/system/io/streamwriter.cs
muradovm's user avatar
1 vote
1 answer
4k views

What default encoding is used when using StreamWriter to write into a file with no Encoding parameter?

I had a situation where we produce a file for our client, and the file would contain some special characters like accented i or a (í, á) etc. Originally, we used this code to open file for output: ...
George's user avatar
  • 2,205

15 30 50 per page