hyphen turns to question mark lazarus / 31-LCL ---------------------------------------------------------------------- SillyOldDragon · 2014-10-26 02:10 When reading from a text file that has hyphens in it and then stuff the text into a stringGrid everything is perfect in both columns except all of the hyphens turn to question marks. Using Windows 7.  Nothing else weird. Any ideas? Thank you - Justine ---------------------------------------------------------------------- engkin · 2014-10-26 02:44 My guess, your text file is Ansi encoded, while the grid needs UTF8. Use Utf8Encode ---------------------------------------------------------------------- SillyOldDragon · 2014-10-26 05:34 Well, I think it's silly but it worked like a charm.  I now have hyphens in my StringGrid. Thank you very much. ---------------------------------------------------------------------- eny · 2014-10-26 07:16 Quote from: SillyOldDragon on October 26, 2014, 03:10:05 amUsing Windows 7.  Nothing else weird.That hyphen is probably not actually a hyphen (ascii 45) but some kind of ansi character that also looks like a hyphen. For example text editors like Word do this.  So if you copy from there and paste into a textfile, you get this situation. Also if the textfile is created from reading a database that is populated by end users, they might have copied/pasted 'special characters'  into text fields. ---------------------------------------------------------------------- engkin · 2014-10-26 13:56 Quote from: eny on October 26, 2014, 08:16:25 amThat hyphen is probably not actually a hyphen (ascii 45) but some kind of ansi character that also looks like a hyphen. It is a hyphen, actually a "soft hyphen". ---------------------------------------------------------------------- eny · 2014-10-26 19:45 Quote from: engkin on October 26, 2014, 02:56:17 pmactually a "soft hyphen". As I said it's not a hyphen. ---------------------------------------------------------------------- engkin · 2014-10-26 19:57 Quote from: eny on October 26, 2014, 08:45:02 pmQuote from: engkin on October 26, 2014, 02:56:17 pmactually a "soft hyphen". As I said it's not a hyphen. What do you mean when you say "not a hyphen"? ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-27 09:40 Quote from: engkin on October 26, 2014, 08:57:39 pmWhat do you mean when you say "not a hyphen"? This was already explained. Quote from: eny on October 26, 2014, 08:16:25 amThat hyphen is probably not actually a hyphen (ascii 45) but some kind of ansi character that also looks like a hyphen. ---------------------------------------------------------------------- engkin · 2014-10-27 15:04 Quote from: Mike.Cornflake on October 27, 2014, 10:40:52 amThis was already explained. Quote from: eny on October 26, 2014, 08:16:25 amThat hyphen is probably not actually a hyphen (ascii 45) but some kind of ansi character that also looks like a hyphen. Thank you Mike  . I-1- What are the reason(s) that would prevent you from considering soft hyphen a hyphen? II-2- Isn't ASCII 45 (XLV) used for minus character (-) as well? Wouldn't that be a reason to have a separate character for hyphen? Please notice that I'm totally unbiased when it comes to hyphens. I do not endorse Microsoft's position on hyphens, not in their Word product nor in any other product. ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-27 15:18 :-)   First time I've seen the ASCII table in Roman Numerals.  I like that :-) I suspect @Eny was simply explaining why "-" was appearing as a question mark.  If the character in question wasn't our XLV, the suspicion was that it was a unicode character that just happened to look like XLV when correctly decoded.  Which in fact, turned out to be the case. I don't think any judgement over whether anything is or isn't a hyphen was intended.  But on the offchance it was, I'm ducking out now :-) ---------------------------------------------------------------------- eny · 2014-10-27 16:10 No reason to duck MC  I'm happy someone actually made an effort to understand my explanation, without taking it out of (the) context (of the thread). ---------------------------------------------------------------------- engkin · 2014-10-27 16:54 I apologize for taking your explanation out of (the) context (of the thread), twisting the meanings of your words, and putting my words in your mouth. ---------------------------------------------------------------------- bzman24 · 2014-10-28 00:45 I've seen ASCII 151 that looks like an elongated hyphen.  In HTML it looks like a double hyphen but when converted to text it looks real close to a real hyphen (ASCII 45).  Is this a 'soft hyphen'? If not what is a 'soft hyphen' and why is it called that? Curious ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-28 01:58 Follow the link for the wiki on soft hyphen. Quote from: engkin on October 26, 2014, 02:56:17 pmQuote from: eny on October 26, 2014, 08:16:25 amIt is a hyphen, actually a "soft hyphen". ---------------------------------------------------------------------- bzman24 · 2014-10-28 02:34 Mike,  Something that we have been using for years to show broken words and never knew they were called that.  Learn something new all the time.  Thanks.  Bzman ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-28 02:53 :-) Now press ctrl shift minus in Microsoft Word to see another variation.The non-breaking hyphen!  :-) ---------------------------------------------------------------------- SillyOldDragon · 2014-10-29 02:23 Maybe I should have said 'minus sign' or 'subtraction operator'.  However, since I was not using it in a mathematic context but as a break in a description (like honey - wildflower   or honey - orange blossom) I just called it a hyphen.  It's on the keyboard between '0' and '='.  I did not mean to start a brouhaha.