Click here to Skip to main content
15,887,477 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Fun with touchpads Pin
PIEBALDconsult4-Jul-15 16:47
mvePIEBALDconsult4-Jul-15 16:47 
GeneralRe: Fun with touchpads Pin
Mike Gaskey5-Jul-15 11:22
Mike Gaskey5-Jul-15 11:22 
GeneralRe: Fun with touchpads Pin
Thanks78726-Jul-15 0:25
professionalThanks78726-Jul-15 0:25 
GeneralRe: Fun with touchpads Pin
Sentenryu6-Jul-15 3:44
Sentenryu6-Jul-15 3:44 
GeneralRe: Fun with touchpads Pin
Fueled By Decaff8-Jul-15 22:25
Fueled By Decaff8-Jul-15 22:25 
GeneralRe: Fun with touchpads Pin
Gary R. Wheeler18-Jul-15 6:21
Gary R. Wheeler18-Jul-15 6:21 
GeneralWhen Default is not the default Pin
kmoorevs30-Jun-15 8:06
kmoorevs30-Jun-15 8:06 
GeneralRe: When Default is not the default Pin
Richard Deeming30-Jun-15 8:16
mveRichard Deeming30-Jun-15 8:16 
The default behaviour is to attempt to detect the encoding based on the Byte Order Mark[^] within the stream's content. If no BOM is found, it falls back to UTF8.

It's mentioned in the remarks on the class:

StreamReader defaults to UTF-8 encoding unless specified otherwise, instead of defaulting to the ANSI code page for the current system. UTF-8 handles Unicode characters correctly and provides consistent results on localized versions of the operating system. If you get the current character encoding using the CurrentEncoding property, the value is not reliable until after the first Read method, since encoding auto detection is not done until the first call to a Read method.

And on the constructor:

This constructor initializes the encoding to UTF8Encoding and the buffer size to 1024 bytes.




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: When Default is not the default Pin
Sander Rossel3-Jul-15 22:14
professionalSander Rossel3-Jul-15 22:14 
GeneralFun with pointers in C++ PinPopular
C3D125-Jun-15 23:57
professionalC3D125-Jun-15 23:57 
GeneralRe: Fun with pointers in C++ Pin
Daniel Pfeffer26-Jun-15 0:12
professionalDaniel Pfeffer26-Jun-15 0:12 
GeneralRe: Fun with pointers in C++ Pin
Mladen Janković26-Jun-15 2:13
Mladen Janković26-Jun-15 2:13 
GeneralRe: Fun with pointers in C++ Pin
Daniel Pfeffer26-Jun-15 5:59
professionalDaniel Pfeffer26-Jun-15 5:59 
GeneralRe: Fun with pointers in C++ Pin
C3D126-Jun-15 2:58
professionalC3D126-Jun-15 2:58 
GeneralRe: Fun with pointers in C++ Pin
Daniel Pfeffer26-Jun-15 5:52
professionalDaniel Pfeffer26-Jun-15 5:52 
GeneralRe: Fun with pointers in C++ Pin
KP Lee30-Jun-15 12:38
KP Lee30-Jun-15 12:38 
GeneralRe: Fun with pointers in C++ Pin
Daniel Pfeffer30-Jun-15 17:56
professionalDaniel Pfeffer30-Jun-15 17:56 
GeneralRe: Fun with pointers in C++ Pin
KP Lee30-Jun-15 18:15
KP Lee30-Jun-15 18:15 
GeneralRe: Fun with pointers in C++ Pin
Daniel Pfeffer30-Jun-15 21:05
professionalDaniel Pfeffer30-Jun-15 21:05 
GeneralRe: Fun with pointers in C++ Pin
grralph11-Jul-15 4:35
grralph11-Jul-15 4:35 
GeneralRe: Fun with pointers in C++ Pin
KP Lee1-Jul-15 15:30
KP Lee1-Jul-15 15:30 
GeneralRe: Fun with pointers in C++ Pin
Bernhard Hiller2-Jul-15 7:49
Bernhard Hiller2-Jul-15 7:49 
GeneralRe: Fun with pointers in C++ Pin
Rob Grainger11-Jul-15 22:43
Rob Grainger11-Jul-15 22:43 
GeneralRe: Fun with pointers in C++ Pin
TheGreatAndPowerfulOz30-Jun-15 9:07
TheGreatAndPowerfulOz30-Jun-15 9:07 
GeneralRe: Fun with pointers in C++ Pin
Luiz Monad24-Jul-15 5:34
professionalLuiz Monad24-Jul-15 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.