Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Please delete your other posts on this. Pin
Luc Pattyn25-Aug-10 1:48
sitebuilderLuc Pattyn25-Aug-10 1:48 
GeneralRe: Please delete your other posts on this. Pin
OriginalGriff25-Aug-10 1:52
mveOriginalGriff25-Aug-10 1:52 
Questioncode for instal my font to client machine when my setup run Pin
Member 274894524-Aug-10 20:07
Member 274894524-Aug-10 20:07 
AnswerRe: code for instal my font to client machine when my setup run Pin
phil.o24-Aug-10 20:41
professionalphil.o24-Aug-10 20:41 
GeneralRe: code for instal my font to client machine when my setup run Pin
DaveyM6924-Aug-10 21:22
professionalDaveyM6924-Aug-10 21:22 
GeneralRe: code for instal my font to client machine when my setup run Pin
Łukasz Nowakowski24-Aug-10 22:00
Łukasz Nowakowski24-Aug-10 22:00 
AnswerRe: code for instal my font to client machine when my setup run Pin
Abhinav S24-Aug-10 20:59
Abhinav S24-Aug-10 20:59 
AnswerRe: code for instal my font to client machine when my setup run Pin
Smithers-Jones25-Aug-10 3:40
Smithers-Jones25-Aug-10 3:40 
Questionhow to reference image Pin
netJP12L24-Aug-10 11:43
netJP12L24-Aug-10 11:43 
AnswerRe: how to reference image Pin
DaveyM6924-Aug-10 11:47
professionalDaveyM6924-Aug-10 11:47 
GeneralRe: how to reference image Pin
netJP12L25-Aug-10 2:23
netJP12L25-Aug-10 2:23 
GeneralRe: how to reference image Pin
DaveyM6925-Aug-10 7:52
professionalDaveyM6925-Aug-10 7:52 
QuestionComparing various algorithms to convert GPS-coordinates to 2D-coordinates Pin
CrIpLeX24-Aug-10 11:09
CrIpLeX24-Aug-10 11:09 
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 

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.