Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: Comparing various algorithms to convert GPS-coordinates to 2D-coordinates Pin
Luc Pattyn24-Aug-10 11:38
sitebuilderLuc Pattyn24-Aug-10 11:38 
GeneralRe: Comparing various algorithms to convert GPS-coordinates to 2D-coordinates Pin
CrIpLeX25-Aug-10 2:00
CrIpLeX25-Aug-10 2:00 
GeneralRe: Comparing various algorithms to convert GPS-coordinates to 2D-coordinates Pin
Luc Pattyn25-Aug-10 2:27
sitebuilderLuc Pattyn25-Aug-10 2:27 
AnswerRe: Comparing various algorithms to convert GPS-coordinates to 2D-coordinates [modified] Pin
Peter_in_278024-Aug-10 11:39
professionalPeter_in_278024-Aug-10 11:39 
GeneralRe: Comparing various algorithms to convert GPS-coordinates to 2D-coordinates Pin
CrIpLeX25-Aug-10 2:01
CrIpLeX25-Aug-10 2:01 
AnswerRe: Comparing various algorithms to convert GPS-coordinates to 2D-coordinates Pin
Bernhard Hiller25-Aug-10 0:27
Bernhard Hiller25-Aug-10 0:27 
QuestionCharacter encoding when reading a text file of unknown encoding, to create an XML file Pin
JohnLBevan24-Aug-10 9:00
professionalJohnLBevan24-Aug-10 9:00 
AnswerRe: Character encoding when reading a text file of unknown encoding, to create an XML file Pin
Luc Pattyn24-Aug-10 9:52
sitebuilderLuc Pattyn24-Aug-10 9:52 
Hi,

Inverso1 wrote:
using (TextReader reader = new StreamReader(filename,true))


AFAIK a text stream constructor without explicit encoding will:
1. look for a byte order mask indicating the stream holds Unicode/UTF8 characters
2. lacking that, assume it is an 8-bit encoding corresponding to the thread's CultureInfo which defaults to your system's default "code page", which would be e.g. 1252 in Western Europe.

As you said 155 would be "single right-pointing angle quotation mark" in standard ANSI (see e.g. here[^]). And it should work well if your system or your thread were set to ANSI.

It also maps OK in Windows code page 1252 (see here[^]). But it wouldn't in many others.

I suspect your system/app is not using a code page that interprets 155 as "single right-pointing angle quotation mark".

I suggest:
1. you have a look at the file using Notepad
2. you check your code page (I don't know how by heart!)
3. you explicitly set the encoding when opening the stream, assuming you know it to be constant.

And of course you'll risk getting in trouble again when dealing with 8-bit text files from different origins, that was after all the reason they invented Unicode.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Character encoding when reading a text file of unknown encoding, to create an XML file Pin
JohnLBevan24-Aug-10 22:33
professionalJohnLBevan24-Aug-10 22:33 
QuestionStrange order of events in ListView with MultiSelect set to false Pin
crypto_rsa24-Aug-10 6:28
crypto_rsa24-Aug-10 6:28 
AnswerRe: Strange order of events in ListView with MultiSelect set to false Pin
Ravi Bhavnani24-Aug-10 8:17
professionalRavi Bhavnani24-Aug-10 8:17 
AnswerRe: Strange order of events in ListView with MultiSelect set to false Pin
DaveyM6924-Aug-10 10:16
professionalDaveyM6924-Aug-10 10:16 
GeneralRe: Strange order of events in ListView with MultiSelect set to false Pin
crypto_rsa24-Aug-10 21:37
crypto_rsa24-Aug-10 21:37 
GeneralRe: Strange order of events in ListView with MultiSelect set to false Pin
johannesnestler24-Aug-10 23:05
johannesnestler24-Aug-10 23:05 
AnswerRe: Strange order of events in ListView with MultiSelect set to false Pin
DaveyM6924-Aug-10 10:41
professionalDaveyM6924-Aug-10 10:41 
GeneralRe: Strange order of events in ListView with MultiSelect set to false Pin
crypto_rsa25-Aug-10 1:12
crypto_rsa25-Aug-10 1:12 
QuestionEditable datagridview Pin
saqib8224-Aug-10 5:37
saqib8224-Aug-10 5:37 
AnswerRe: Editable datagridview Pin
dan!sh 24-Aug-10 6:00
professional dan!sh 24-Aug-10 6:00 
GeneralRe: Editable datagridview Pin
saqib8224-Aug-10 6:07
saqib8224-Aug-10 6:07 
GeneralRe: Editable datagridview Pin
dan!sh 24-Aug-10 6:24
professional dan!sh 24-Aug-10 6:24 
GeneralRe: Editable datagridview Pin
saqib8224-Aug-10 6:39
saqib8224-Aug-10 6:39 
AnswerRe: Editable datagridview Pin
Mada Naga Sankar25-Aug-10 19:38
Mada Naga Sankar25-Aug-10 19:38 
Questionproblem with invoke method. it says cannot call invoke on a control until the window handle has been created Pin
prasadbuddhika24-Aug-10 4:59
prasadbuddhika24-Aug-10 4:59 
AnswerRe: problem with invoke method. it says cannot call invoke on a control until the window handle has been created Pin
Luc Pattyn24-Aug-10 5:32
sitebuilderLuc Pattyn24-Aug-10 5:32 
AnswerRe: problem with invoke method. it says cannot call invoke on a control until the window handle has been created Pin
Chris Trelawny-Ross24-Aug-10 5:34
Chris Trelawny-Ross24-Aug-10 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.