From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Making re-search-forward search for \377 Date: Sun, 2 Nov 2008 12:32:53 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <87tzaqporw.fsf@pcdesk.net> <87prlepk45.fsf@pcdesk.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225658445 13652 80.91.229.12 (2 Nov 2008 20:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Nov 2008 20:40:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 02 21:41:46 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KwjlZ-0007kI-1G for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Nov 2008 21:41:45 +0100 Original-Received: from localhost ([127.0.0.1]:37262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwjkS-0002L6-6e for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Nov 2008 15:40:36 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!e1g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 93 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1225657973 5758 127.0.0.1 (2 Nov 2008 20:32:53 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 2 Nov 2008 20:32:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e1g2000pra.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164020 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59362 Archived-At: Xah Lee wrote: > Xah writes: > > what's the C-q 377 char? > > > if i press Ctrl+q 377 Enter, i get this char: =C3=BF, which is LATIN SM= ALL > > LETTER Y WITH DIAERESIS (unicode U+00FF). > > > Then if i do: > > > (re-search-forward "=C3=BF") Tyler Spivey wrote: > I'm probably going to end up working with binary data in a temp > buffer. Doing more research, I want enable-multibyte-characters to be > off. Given that, if we go to *scratch* > and run M-X toggle-enable-multibyte-characters until that variable > becomes nil, doing C-Q 377 RET gives 0xff, which is what I want > (according to C-x =3D, C-u C-x =3D and M-x describe-char). Now to > match it, I try: > > (re-search-forward "\xff") - no luck sorry can't help you much there. ...i don't have much experience working with binary data. > What did you use to figure out that the multibyte version of that > character was 0x00FF? I found it out accidentally as a lisp error, but > none of the previously described commands (C-X =3D, M-X describe-char or > C-u C-x =3D) will show that it is 0x00ff, they just show FF. installing a unicode data file is probably what you need. Q: I have this character =CE=B1 on the screen. How to find out its unicode's hex value or name? You can find out a character's decimal, octal, or hex values by placing your cursor on the character, and type =E2=80=9CAlt+x what-cursor- position=E2=80=9D (Ctrl+x =3D). You can get more info if you place your cur= sor on the character, then press =E2=80=9CCtrl+u Ctrl+x =3D=E2=80=9D. However, if you want the complete unicode info of a character, you need to download a unicode data file and let emacs know where it is. The unicode data file can be downloaded at: http://www.unicode.org/Public/U= NIDATA/UnicodeData.txt. After you downloaded it, place the following code in your =E2=80=9C~/.emacs= =E2=80=9D to let emacs know where it is: ; set unicode data file location. (used by what-cursor-position) (let ((x "~/Documents/emacs/UnicodeData.txt")) (when (file-exists-p x) (setq describe-char-unicodedata-file x))) Then restart emacs. Once you've done this, then place your cursor on a unicode char, and do =E2=80=9CCtrl+u Ctrl+x =3D=E2=80=9D, then emacs will g= ive you all the unicode info about that char, including the code point in decimal, octal, hex notations, as well the unicode character name, category, the font emacs is using, and others. For example, here's the output on the character =E2=80=9C=CE=B1=E2=80=9D: character: =CE=B1 (332721, #o1211661, #x513b1, U+03B1) charset: mule-unicode-0100-24ff (Unicode characters of the range U+0100..U+24FF.) code point: #x27 #x31 syntax: w which means: word category: g:Greek buffer code: #x9C #xF4 #xA7 #xB1 file code: #xCE #xB1 (encoded by coding system mule-utf-8-unix) display: by this font (glyph code) -apple-symbol-medium-r-normal--14-140-72-72-m-140-mac-symbol (#x61) Unicode data: Name: GREEK SMALL LETTER ALPHA Category: lowercase letter Combining class: Spacing Bidi category: Left-to-Right Uppercase: =CE=91 Titlecase: =CE=91 There are text properties here: fontified t this page might help you if you work with unicode. http://xahlee.org/emacs/emacs_n_unicode.html Xah =E2=88=91 http://xahlee.org/ =E2=98=84