Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emacs buffer showing escaped numbers instead of chars
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
nordic bro
Guru
Guru


Joined: 25 Oct 2003
Posts: 585

PostPosted: Tue Feb 12, 2013 2:13 am    Post subject: emacs buffer showing escaped numbers instead of chars Reply with quote

aren't really sure how else to describe that :) I have to look at plain-text logs from ppl around the world and often get stuff like this:

Code:
Executing the runtime installer: C:\Users\ \217\230\254\242

I also frequently get that kind of escaped number substitution for things like the british pound currency symbol, euro currency symbol, etc. once in awhile the euro symbol will actually display but 95% I get escaped numbers.

so I got a utf8 demo txt file to see if that would display ok and it does. all kinds of math symbols like integrals, sigma, other languages, etc. that demo file is an ordinary text file, no codes to tell it how an editor should handle it when loading afaict. emacs modeline says "Text". it also doesn't show a single escaped number.

anyone know what I might be missing wrt emacs settings and whatnot? it's 23.x and like I say, it can display properly but in the logs I look at all I usually get are the escaped numbers.
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Feb 12, 2013 5:06 pm    Post subject: Reply with quote

Does it do this in all modes or just certain ones?
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
nordic bro
Guru
Guru


Joined: 25 Oct 2003
Posts: 585

PostPosted: Tue Feb 12, 2013 9:49 pm    Post subject: Reply with quote

I haven't really checked or tried others, it's in "Text mode" once either a problematic log or the utf8 demo file are loaded (former displays escaped numbers, latter doesn't). I compared the buffers' minor modes and they're identical for both and look like ordinary stuff such as font-lock, auto-fill, etc.

I had also tried starting emacs w/-q to see if problematic logs would display correctly but they didn't.
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Feb 12, 2013 10:13 pm    Post subject: Reply with quote

Interesting. My emacs opens log files in "fundamental" mode, and I don't see any problems. I'm using 24.2. Opening an emerge log (which is what it looks like you're viewing) I also don't see any problems. Don't see any problems when switching to text mode.

I'm sorry, but I can't duplicate this. Maybe it's some add-on you installed? Maybe it's locale-related?
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1553
Location: Adelaide/Australia

PostPosted: Thu Feb 14, 2013 11:20 am    Post subject: Reply with quote

I am a regular user of Emacs.
What you are seeing is when you see \217 is a character that is outside ASCII range (above 127)
ASCII characters are < 128 (decimal), whereas 217 (octal) is 143 (decimal), which is outside the normal US range. It actually resides in the extended characters, which are typically graphic or characters with accents.

See http://www.asciitable.com/

Feel free to translate those individual characters to see what they look like in the above page. :)
_________________
...Lyall
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Thu Feb 14, 2013 9:06 pm    Post subject: Reply with quote

Can this be fixed by enabling "wide characters" or something?
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1553
Location: Adelaide/Australia

PostPosted: Fri Feb 15, 2013 5:42 am    Post subject: Reply with quote

It's how emacs works, when displaying non-ascii characters.

Check out

http://www.chemie.fu-berlin.de/chemnet/use/info/elisp/elisp_36.html#SEC558

or

http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Display.html
_________________
...Lyall
Back to top
View user's profile Send private message
nordic bro
Guru
Guru


Joined: 25 Oct 2003
Posts: 585

PostPosted: Tue Feb 19, 2013 8:45 pm    Post subject: Reply with quote

arrggh this is annoying :) I don't really know about how locale/env/lang settings will/won't affect how emacs displays plain text buffers but I got another log today where plain as day, euro currency symbol displays in emacs perfectly fine. a representative log I saved awhile back where it won't display shows this:

\342\202\254

I typed that in; if I copy/paste the string from the emacs buffer here or into terminal I get this:



what does this mean? that is, something when copying w/mouse recognizes what that string is in the emacs buffer yet emacs itself shows the string, not the symbol. then there are infrequent times like today where emacs does show the symbol rather than the string.

the logs are 100% ordinary text files (usually DOS text since I deal mostly w/win users). sometimes I may d/l to my machine before opening, sometimes I'll open their attachment directly using a ffox add-on ("viewsourcewith"). I can't say for sure if one or the other stands a better chance of emacs not showing the string but given I overwhelmingly get the string rather than the symbol, and I open w/both methods dozens of times a day, I'm somewhat confident this doesn't have anything to do with it.
Back to top
View user's profile Send private message
nordic bro
Guru
Guru


Joined: 25 Oct 2003
Posts: 585

PostPosted: Wed Feb 20, 2013 7:51 am    Post subject: Reply with quote

think I found the trouble - 'file x' (displays string) says this:

Non-ISO extended-ASCII English text

'file y' which shows the euro symbol says this:

UTF-8 Unicode English text

not sure how a file ends up one way or the other but this must be what's the matter. if I could figure out how to use iconv on something that says "charset=unknown-8bit" I'd know for sure :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum