Results 1 to 4 of 4
Thread: Issues with weird characters
- 12-09-2011, 10:47 AM #1
Member
- Join Date
- May 2011
- Posts
- 38
- Rep Power
- 0
Issues with weird characters
I am having weird characters that show up in my java program such as "€¯â€¯". I am using inputStream and reading from a .txt file. Also, what is weird is that when I run in netbeans preview mode or as an executable .jar I get different results. When running in netbeans preview I get two squares and as a .jar I get "€¯â€¯". Is this something possibly with encoding settings? I have no knowledge about this, if someone could help out I would appreciate it.
- 12-09-2011, 12:12 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Re: Issues with weird characters
The file is written in one character encoding and the system is reading in a different character encoding.
- 12-09-2011, 09:29 PM #3
Member
- Join Date
- May 2011
- Posts
- 38
- Rep Power
- 0
Re: Issues with weird characters
I care about how the jar shows the text file so is there anyway for me to manually change the settings output on jar?
- 12-09-2011, 10:39 PM #4
Re: Issues with weird characters
Wrap your InputStream in an InputStreamReader and specify the charset in the InputStreamReader's constructor. Then it will always use the same charset regardless of the system default.
Get in the habit of using standard Java naming conventions!
Similar Threads
-
Weird NullPointerException
By Hollowsoul in forum JCreatorReplies: 2Last Post: 07-13-2011, 10:46 PM -
Weird NullPointerException
By Boreeas in forum New To JavaReplies: 7Last Post: 07-12-2011, 11:30 AM -
Weird output
By gandalf5166 in forum New To JavaReplies: 2Last Post: 02-28-2010, 09:17 PM -
weird problem
By GPB in forum New To JavaReplies: 2Last Post: 02-28-2010, 12:04 PM -
Weird Error?
By sciguy77 in forum New To JavaReplies: 4Last Post: 01-20-2009, 02:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks