Web Server forum
Back To The Forum Home!Search!Private Messaging System

This is Interesting: Free IT Magazines Now Free shipping to   
Web Server Talk Web Server Talk > Unix and Linux reviews > Editors > Emacs > mule-ucs and character sets problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    mule-ucs and character sets problem  
Haines Brown


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-10-05 01:45 AM

I reinstalled emacs 21.4.1 under debian sarge, and since then have had
some character set difficulties. I was under the impression that this
version of emacs had built-in support for mule-ucs, and so I didn't
migrate ~/elisp/mule-ucs over to the new installation. Could that be
my problem?

Here is an example of the character set problems. I have an html
working file in Spanish that had some octals because it had originally
used some of the illicit MS character encodings. I converted all these
octals to decimals (for example, \226 to –) and then tried to
save the file. Howver, I get the error message:

These default coding systems were tried:
undecided-unix iso-latin-1
However, none of them safely encodes the target text.

Select one of the following safe coding systems:
mule-utf-16-be mule-utf-16-le utf-8 raw-text emacs-mule
no-conversion

And in the minibuffer: Select coding system (default mule-utf-16-be):
However, select the default did nothing and I can't save. I suppose I
could save as raw-text, but I'm anxious to resolve the problem, not
work around it.

I don't know what "undecided-unix" implies, and I'm unclear about the
difference between "raw-text" and "no-conversion."

--

Haines Brown





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Reiner Steib


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 12:46 PM

On Sat, Apr 09 2005, Haines Brown wrote:

> I reinstalled emacs 21.4.1 under debian sarge, and since then have had
> some character set difficulties. I was under the impression that this
> version of emacs had built-in support for mule-ucs, and so I didn't
> migrate ~/elisp/mule-ucs over to the new installation. Could that be
> my problem?

AFAIK, the builtin Unicode support in Emacs 21 should be sufficient
for European languages.

>   These default coding systems were tried:
>     undecided-unix iso-latin-1
>   However, none of them safely encodes the target text.
>
>   Select one of the following safe coding systems:
>     mule-utf-16-be mule-utf-16-le utf-8 raw-text emacs-mule
>     no-conversion
>
> And in the minibuffer: Select coding system (default mule-utf-16-be):
> However, select the default did nothing and I can't save. I suppose I
> could save as raw-text, but I'm anxious to resolve the problem, not
> work around it.

I'm not sure, but maybe this could help:

;; X-URL: http://theotp1.physik.uni-ulm.de/~s.../>
21-3-fix.el
[...]
;;; Commentary:

;; Emacs 21.3 and Emacs 21.4 come with a slightly broken version of the
;; function `sort-coding-systems'.  Therefore in some cases, Gnus uses
;; utf-16-x rather than utf-8.  Additionally, it's not correct utf-16-be.  S
ee
;; <URL:http://news.gmane.org/v9adfeig1c.fs...ysik.uni-ulm.de> for
;; details.
;;
;; This file provides a simple solution for this problem.  It's specific to
;; these Emacs versions, don't use is with other Emacs versions.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Haines Brown


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 10:46 PM

Reiner Steib <reinersteib+from-uce@imap.cc> writes:
 
>
> I'm not sure, but maybe this could help:
>
> ;; X-URL: http://theotp1.physik.uni-ulm.de/~s...
s-21-3-fix.el
> [...]
> ;;; Commentary:
>
> ;; Emacs 21.3 and Emacs 21.4 come with a slightly broken version of the
> ;; function `sort-coding-systems'.  Therefore in some cases, Gnus uses
> ;; utf-16-x rather than utf-8.  Additionally, it's not correct utf-16-be. 
 See
> ;; <URL:http://news.gmane.org/v9adfeig1c.fs...ysik.uni-ulm.de> f
or
> ;; details.
> ;;
> ;; This file provides a simple solution for this problem.  It's specific t
o
> ;; these Emacs versions, don't use is with other Emacs versions.

Thank you, it does seem I need the patch. Unfortunately, I'm a lisp
ignoramus and seem to have groked the .el file.

I cut the needed .el file lines from the recommended URL and put it
into ~/elisp. However, I also carefull removed the two comment
semicolons at the start of each line. As a result, the first three
lines (starting --, +++ and @) wouldn't parse, and so I re-commented
them. But then I remained with a error:

End of file during parsing:
/home/brownh/elisp/rs-sort-coding-systems-21-3-fix.el

I played with the end of the file (removing spaces; adding a blank
line), but without luck.

--

Haines Brown





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Reiner Steib


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 10:46 PM

On Mon, Apr 11 2005, Haines Brown wrote:

> Reiner Steib <reinersteib+from-uce@imap.cc> writes: 
[...][vbcol=seagreen]
> I cut the needed .el file lines from the recommended URL and put it
> into ~/elisp. However, I also carefull removed the two comment
> semicolons at the start of each line. As a result, the first three
> lines (starting --, +++ and @) wouldn't parse, and so I re-commented
> them.

I wonder what's unclear about the installation instruction in the
file:

;;; Installation:

;; Put `rs-sort-coding-systems-21-3-fix.el' in a directory that's at the
;; beginning of your `load-path', e.g. ~/lisp:
;;
;; ;; Make sure this path comes before system paths:
;; (setq load-path (nconc (list "~/lisp") load-path))
;;
;; Load the file, by adding the following in your startup file (usually
;; ~/.emacs):
;;
;; (require 'rs-sort-coding-systems-21-3-fix)
;;
;; That's all.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Haines Brown


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 10:46 PM

Reiner,

Thanks for your patience, and I apologize for not being clearer about
my difficulty. Here's the section of the directions about which I was
speaking:

;; This is the relevant patch:

;; --8<---------------cut here---------------start------------->8---
;; --- mule-cmds.el	26 Dec 2002 17:27:20 -0000	1.216
;; +++ mule-cmds.el	3 Jan 2003 20:16:11 -0000	1.217
;; @@ -425,9 +425,18 @@
;;  		    (let ((base (coding-system-base x)))
;;  		      (+ (if (eq base most-preferred) 64 0)
;;  			 (let ((mime (coding-system-get base 'mime-charset)))
;; +			   ;; Prefer coding systems corresponding to a
...

I extracted the material below the "cut here" and before the "cut
here... end." I then removed all the initial semi-colons at the
beginning of each line so that the lines would appear as:

--- mule-cmds.el	26 Dec 2002 17:27:20 -0000	1.216
+++ mule-cmds.el	3 Jan 2003 20:16:11 -0000	1.217
@@ -425,9 +425,18 @@
(let ((base (coding-system-base x)))
(+ (if (eq base most-preferred) 64 0)
(let ((mime (coding-system-get base 'mime-charset)))
+			   ;; Prefer coding systems corresponding to a
..

This wouldn't parse, and so I restored the first three lines as a
comment as such:

;; --- mule-cmds.el	26 Dec 2002 17:27:20 -0000	1.216
;; +++ mule-cmds.el	3 Jan 2003 20:16:11 -0000	1.217
;; @@ -425,9 +425,18 @@
(let ((base (coding-system-base x)))
(+ (if (eq base most-preferred) 64 0)
(let ((mime (coding-system-get base 'mime-charset)))
+			   ;; Prefer coding systems corresponding to a
...

and I received the error message concerning end of file. Otherwise,
the instructions were quite clear.

--

Haines Brown





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Reiner Steib


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 10:46 PM

On Mon, Apr 11 2005, Haines Brown wrote:

> Thanks for your patience, and I apologize for not being clearer about
> my difficulty. Here's the section of the directions about which I was
> speaking:  [...]

Everything between ";; That's all." and ";;; Code:" is background
information.  Just forget about it.  I should separate it more clearly
from the ";;; Installation:" section.

Just follow the part cited in my previous message.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Haines Brown


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-12-05 01:45 AM

Aha! I was looking at the wrong coding altogether. Now I'm trying the
material at the end of the file, the material after "The original
version from `international/mule-cmds.el' is broken.  This":

(if sort-coding-systems-predicate
(sort codings sort-coding-systems-predicate)

..

;;; rs-sort-coding-systems-21-3-fix.el ends here

But still a problem:c "Symbol's value as variable is void: coding". I
regret being such a dullard in what should be a simple matter.

--

Haines Brown





[ Post a follow-up to this message ]



    Re: mule-ucs and character sets problem  
Reiner Steib


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-12-05 12:45 PM

On Tue, Apr 12 2005, Haines Brown wrote:

> Aha! I was looking at the wrong coding altogether. Now I'm trying the
> material at the end of the file, [...]

You don't need to extract any material from the file.  Put the
complete file `rs-sort-coding-systems-21-3-fix.el' in a directory
that's at the beginning of your `load-path', e.g. ~/lisp:

;; Make sure this path comes before system paths:
(setq load-path (nconc (list "~/lisp") load-path))

Load the file, by adding the following in your startup file (usually
~/.emacs):

(require 'rs-sort-coding-systems-21-3-fix)

That's all.  Restart Emacs.


How to make sure it is working correctly?  Copy the following line
into the *scratch* buffer and hit `C-j':

(car (sort-coding-systems '(mule-utf-16-be mule-utf-16-le mule-utf-8)))

It should return mule-utf-8.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:08 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

Back To The Top
Home | Usercp | Faq | Register