Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 102329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:56:32+00:00 2026-05-11T00:56:32+00:00

I am completely stumped. I have a program that pulls information stored in a

  • 0

I am completely stumped. I have a program that pulls information stored in a database, assigns the database values to a corresponding class. The class has a print method that prints the values of it’s fields. The users type in either an order id or order date range and then it finds those orders and prints them out to a text file. The problem I am having is that once in a awhile, depending on what id’s and date’s you pick, the text file will print out garbage like this. ‘〢Ⱒⰱ潋瑲刬瑵慨湮圬扥†′慍歲瑥㔬㈶‸⁗㈱琰⁨瑓敲瑥Ⱜ汁楳Ɒ䱉㘬㠰㌰’ I am completely clueless here because when I debug it, all the values show correctly in the class, the print method, and result set. What could be the problem? Has anyone had this happen to them?

The OS is Windows Vista, the language I’m using is C#. I am using a StreamWriter class with a FileStream as a parameter.

This only happens with some orders. Like if I pick order 7 or order 1-6 it works fine, but if I pick 1-7, I get the weird language. ????

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:56:33+00:00Added an answer on May 11, 2026 at 12:56 am

    Based on your comment what happens is that Notepad try to guess the encoding of the file. Look here for how it does so.

    You should be explicit about the encoding of the file.

    From the documentation:

    StreamWriter defaults to using an instance of UTF8Encoding unless specified otherwise. This instance of UTF8Encoding is constructed without a Byte-Order Mark (BOM), so its GetPreamble method returns an empty byte array. To create a StreamWriter using UTF-8 encoding and a BOM, consider using a constructor that specifies encoding, such as StreamWriter(String, Boolean, Encoding).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm completely stumped on this one. I have three different lists that need to
I an issue that has me completely stumped. I am simply running a simple
I am completely stumped as to why this code does not get any SDL
Is it completely against the Java way to create struct like objects? class SomeData1
This is more then likely a very simple question but I am completely stumped
I have been able to get my database queries to work properly for deleting
I completely understand the concept of expression trees, but I am having a hard
I've never been completely happy with the way exception handling works, there's a lot
I haven't completely understood, how to use sigprocmask() . Particularly, how the set and
I am completely new to ruby and I inherited a ruby system for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.