all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [patch] add support for ibm278
@ 2020-12-24 15:39 Timo Myyrä
  2020-12-24 18:56 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Timo Myyrä @ 2020-12-24 15:39 UTC (permalink / raw)
  To: emacs-devel

Hi,

In recent history I had to check file from our customer which was
showing gibberish. It seems emacs is missing few defines in order to use
ibm278 encoding. There already seems to be charset map for ibm278 in
etc/charsets so emacs is only missing few defines in order to use ibm278
encoding:

add support for ebcdic code page ibm278 for finnish/swedish

there was already charset file present in etc/charsets but it wasn't
hooked to mule. This defines charset and coding system to use ibm278
with emacs.

2 files changed, 13 insertions(+)
lisp/international/mule-conf.el | 7 +++++++
lisp/language/european.el       | 6 ++++++

modified   lisp/international/mule-conf.el
@@ -1075,6 +1075,13 @@ 'ibm038
 (define-charset-alias 'ebcdic-int 'ibm038)
 (define-charset-alias 'cp038 'ibm038)
 
+(define-charset 'ibm278
+  "Finnish/swedish version of EBCDIC"
+  :short-name "IBM038"
+  :code-space [0 255]
+  :mime-charset 'ibm278
+  :map "IBM278")
+
 (define-charset 'ibm1047
   ;; Says groff:
   "IBM1047, `EBCDIC Latin 1/Open Systems' used by OS/390 Unix."
modified   lisp/language/european.el
@@ -324,6 +324,12 @@ 'windows-1257
   :mime-charset 'windows-1257)
 (define-coding-system-alias 'cp1257 'windows-1257)
 
+(define-coding-system 'ibm278
+  "Finnish/Swedish version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm278)
+  :mnemonic ?*)
+
 (define-coding-system 'cp775
   "DOS codepage 775 (PC Baltic, MS-DOS Baltic Rim)"
   :coding-type 'charset




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] add support for ibm278
  2020-12-24 15:39 [patch] add support for ibm278 Timo Myyrä
@ 2020-12-24 18:56 ` Eli Zaretskii
  2020-12-25 11:21   ` Timo Myyrä
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-12-24 18:56 UTC (permalink / raw)
  To: Timo Myyrä; +Cc: emacs-devel

> From: Timo Myyrä <timo.myyra@bittivirhe.fi>
> Date: Thu, 24 Dec 2020 17:39:25 +0200
> 
> add support for ebcdic code page ibm278 for finnish/swedish

Thanks.  I think this needs a couple of aliases, like cp278,
ebcdic-se-fi, etc.

Also, if we are going to add this variant of EBCDIC, might as well add
the other IBM2xx codepages as well (with the respective aliases).



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] add support for ibm278
  2020-12-24 18:56 ` Eli Zaretskii
@ 2020-12-25 11:21   ` Timo Myyrä
  2020-12-25 14:02     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Timo Myyrä @ 2020-12-25 11:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> [2020-12-24, 20:56 +0200]:

>> From: Timo Myyrä <timo.myyra@bittivirhe.fi>
>> Date: Thu, 24 Dec 2020 17:39:25 +0200
>> 
>> add support for ebcdic code page ibm278 for finnish/swedish
>
> Thanks.  I think this needs a couple of aliases, like cp278,
> ebcdic-se-fi, etc.
>
> Also, if we are going to add this variant of EBCDIC, might as well add
> the other IBM2xx codepages as well (with the respective aliases).

Ok, I'm not sure about other ebcdic code pages but heres them added as
well.

I based my naming from IBM support docs and libintl-perl CPAN library:
https://www.ibm.com/support/knowledgecenter/en/SS3JRN_7.2.1/com.ibm.itcama.doc_7.2.1/oracleextended/fac_oracle_codepage.html
https://metacpan.org/release/libintl-perl

I'm don't have a clue whats in ebcdic-jp-e or how ebcdic-cp-gb is
different from ebcdic-uk. How does this look?

Timo

From cbcadd62b967238266bb4d38a00a605e9401751b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Myyr=C3=A4?= <timo.myyra@bittivirhe.fi>
Date: Thu, 24 Dec 2020 17:29:49 +0200
Subject: [PATCH] add support for EBCDIC code pages IBM2XX

there was already charset file present in etc/charsets for IBM2XX
character sets but there wasn't definitions for them in the
elisp. Add character set and coding system definitions these.
---
 lisp/international/mule-conf.el | 109 ++++++++++++++++++++++++++++++++
 lisp/language/english.el        |   8 +++
 lisp/language/european.el       |  73 +++++++++++++++++++++
 lisp/language/japanese.el       |  16 +++++
 4 files changed, 206 insertions(+)

diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index 99449ad359..dd6d0326d7 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1075,6 +1075,115 @@ 'ibm038
 (define-charset-alias 'ebcdic-int 'ibm038)
 (define-charset-alias 'cp038 'ibm038)
 
+(define-charset 'ibm256
+  "Netherlands version of EBCDIC"
+  :short-name "IBM256"
+  :code-space [0 255]
+  :mime-charset 'ibm256
+  :map "IBM256")
+(define-charset-alias 'ebcdic-int1 'ibm256)
+(define-charset-alias 'cp256 'ibm256)
+
+(define-charset 'ibm273
+  "Austrian / German version of EBCDIC"
+  :short-name "IBM273"
+  :code-space [0 255]
+  :mime-charset 'ibm273
+  :map "IBM273")
+(define-charset-alias 'cp273 'ibm273)
+
+(define-charset 'ibm274
+  "Belgian version of EBCDIC"
+  :short-name "IBM274"
+  :code-space [0 255]
+  :mime-charset 'ibm274
+  :map "IBM274")
+(define-charset-alias 'ebcdic-be 'ibm274)
+(define-charset-alias 'cp274 'ibm274)
+
+(define-charset 'ibm275
+  "Brazilian version of EBCDIC"
+  :short-name "IBM275"
+  :code-space [0 255]
+  :mime-charset 'ibm275
+  :map "IBM275")
+(define-charset-alias 'ebcdic-br 'ibm275)
+(define-charset-alias 'cp275 'ibm275)
+
+(define-charset 'ibm277
+  "Danish / Norwegian version of EBCDIC"
+  :short-name "IBM277"
+  :code-space [0 255]
+  :mime-charset 'ibm277
+  :map "IBM277")
+(define-charset-alias 'ebcdic-cp-dk 'ibm277)
+(define-charset-alias 'ebcdic-cp-no 'ibm277)
+(define-charset-alias 'cp277 'ibm277)
+
+(define-charset 'ibm278
+  "Finnish / Swedish version of EBCDIC"
+  :short-name "IBM278"
+  :code-space [0 255]
+  :mime-charset 'ibm278
+  :map "IBM278")
+(define-charset-alias 'ebcdic-cp-fi 'ibm278)
+(define-charset-alias 'ebcdic-cp-se 'ibm278)
+(define-charset-alias 'cp278 'ibm278)
+
+(define-charset 'ibm280
+  "Italian version of EBCDIC"
+  :short-name "IBM280"
+  :code-space [0 255]
+  :mime-charset 'ibm270
+  :map "IBM280")
+(define-charset-alias 'ebcdic-cp-it 'ibm280)
+(define-charset-alias 'cp280 'ibm280)
+
+(define-charset 'ibm281
+  "Japanese-E version of EBCDIC"
+  :short-name "IBM281"
+  :code-space [0 255]
+  :mime-charset 'ibm281
+  :map "IBM281")
+(define-charset-alias 'ebcdic-jp-e 'ibm281)
+(define-charset-alias 'cp281 'ibm281)
+
+(define-charset 'ibm284
+  "Spanish version of EBCDIC"
+  :short-name "IBM284"
+  :code-space [0 255]
+  :mime-charset 'ibm284
+  :map "IBM284")
+(define-charset-alias 'ebcdic-cp-es 'ibm284)
+(define-charset-alias 'cp284 'ibm284)
+
+(define-charset 'ibm285
+  "UK english version of EBCDIC"
+  :short-name "IBM285"
+  :code-space [0 255]
+  :mime-charset 'ibm285
+  :map "IBM285")
+(define-charset-alias 'ebcdic-cp-gb 'ibm285) ;; how this differs from ebcdic-uk?
+(define-charset-alias 'cp285 'ibm285)
+
+(define-charset 'ibm290
+  "Japanese katakana version of EBCDIC"
+  :short-name "IBM290"
+  :code-space [0 255]
+  :mime-charset 'ibm290
+  :map "IBM290")
+(define-charset-alias 'ebcdic-jp-kana 'ibm290)
+(define-charset-alias 'cp290 'ibm290)
+
+(define-charset 'ibm297
+  "French version of EBCDIC"
+  :short-name "IBM297"
+  :code-space [0 255]
+  :mime-charset 'ibm297
+  :map "IBM297")
+(define-charset-alias 'ebcdic-cp-fr 'ibm297)
+(define-charset-alias 'cp297 'ibm297)
+
 (define-charset 'ibm1047
   ;; Says groff:
   "IBM1047, `EBCDIC Latin 1/Open Systems' used by OS/390 Unix."
diff --git a/lisp/language/english.el b/lisp/language/english.el
index b7af84c8f7..d5254effa9 100644
--- a/lisp/language/english.el
+++ b/lisp/language/english.el
@@ -70,6 +70,14 @@ 'ibm038
 (define-coding-system-alias 'ebcdic-int 'ibm038)
 (define-coding-system-alias 'cp038 'ibm038)
 
+(define-coding-system 'ibm275
+  "Brazilian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm275)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-br 'ibm275)
+(define-coding-system-alias 'cp275 'ibm275)
+
 ;; Make "ASCII" an alias of "English" language environment.
 (set-language-info-alist
  "ASCII" (cdr (assoc "English" language-info-alist)))
diff --git a/lisp/language/european.el b/lisp/language/european.el
index 713a0fdb34..99f062215f 100644
--- a/lisp/language/european.el
+++ b/lisp/language/european.el
@@ -324,6 +324,79 @@ 'windows-1257
   :mime-charset 'windows-1257)
 (define-coding-system-alias 'cp1257 'windows-1257)
 
+(define-coding-system 'ibm256
+  "Netherlands version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm256)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-int1 'ibm256)
+(define-coding-system-alias 'cp256 'ibm256)
+
+(define-coding-system 'ibm273
+  "Austrian / German version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm273)
+  :mnemonic ?*)
+(define-coding-system-alias 'cp273 'ibm273)
+
+(define-coding-system 'ibm274
+  "Belgian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm274)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-be 'ibm274)
+(define-coding-system-alias 'cp274 'ibm274)
+
+(define-coding-system 'ibm277
+  "Danish / Norwegian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm277)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-dk 'ibm277)
+(define-coding-system-alias 'ebcdic-cp-no 'ibm277)
+(define-coding-system-alias 'cp277 'ibm277)
+
+(define-coding-system 'ibm278
+  "Finnish / Swedish version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm278)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-fi 'ibm278)
+(define-coding-system-alias 'ebcdic-cp-se 'ibm278)
+(define-coding-system-alias 'cp278 'ibm278)
+
+(define-coding-system 'ibm280
+  "Italian version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm280)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-it 'ibm280)
+(define-coding-system-alias 'cp280 'ibm280)
+
+(define-coding-system 'ibm284
+  "Spanish version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm284)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-es 'ibm284)
+(define-coding-system-alias 'cp284 'ibm284)
+
+(define-coding-system 'ibm285
+  "UK english version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm285)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-gb 'ibm285)
+(define-coding-system-alias 'cp285 'ibm285)
+
+(define-coding-system 'ibm297
+  "French version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm297)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-cp-fr 'ibm297)
+(define-coding-system-alias 'cp297 'ibm297)
+
 (define-coding-system 'cp775
   "DOS codepage 775 (PC Baltic, MS-DOS Baltic Rim)"
   :coding-type 'charset
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el
index 9a99245dfd..a517b4ea8e 100644
--- a/lisp/language/japanese.el
+++ b/lisp/language/japanese.el
@@ -188,6 +188,22 @@ 'japanese-shift-jis-2004
 
 (define-coding-system-alias 'shift_jis-2004 'japanese-shift-jis-2004)
 
+(define-coding-system 'ibm281
+  "Japanese-E version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm281)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-jp-e 'ibm281)
+(define-coding-system-alias 'cp281 'ibm281)
+
+(define-coding-system 'ibm290
+  "Japanese katakana version of EBCDIC"
+  :coding-type 'charset
+  :charset-list '(ibm290)
+  :mnemonic ?*)
+(define-coding-system-alias 'ebcdic-jp-kana 'ibm290)
+(define-coding-system-alias 'cp290 'ibm290)
+
 (set-language-info-alist
  "Japanese" '((setup-function . setup-japanese-environment-internal)
 	      (exit-function . use-default-char-width-table)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] add support for ibm278
  2020-12-25 11:21   ` Timo Myyrä
@ 2020-12-25 14:02     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2020-12-25 14:02 UTC (permalink / raw)
  To: Timo Myyrä; +Cc: emacs-devel

> From: Timo Myyrä <timo.myyra@bittivirhe.fi>
> Cc: emacs-devel@gnu.org
> Date: Fri, 25 Dec 2020 13:21:54 +0200
> 
> Eli Zaretskii <eliz@gnu.org> [2020-12-24, 20:56 +0200]:
> 
> >> From: Timo Myyrä <timo.myyra@bittivirhe.fi>
> >> Date: Thu, 24 Dec 2020 17:39:25 +0200
> >> 
> >> add support for ebcdic code page ibm278 for finnish/swedish
> >
> > Thanks.  I think this needs a couple of aliases, like cp278,
> > ebcdic-se-fi, etc.
> >
> > Also, if we are going to add this variant of EBCDIC, might as well add
> > the other IBM2xx codepages as well (with the respective aliases).
> 
> Ok, I'm not sure about other ebcdic code pages but heres them added as
> well.

Thanks, I installed this on the master branch, minus the charset
aliases, which I think are not needed (as opposed to coding-system
aliases).

Please in the future accompany the patches with a ChangeLog-style
commit log message which names the files and the functions where you
made the changes.  (I provided this for you in this case.)  See the
file CONTRIBUTE for the details about that.

> I based my naming from IBM support docs and libintl-perl CPAN library:
> https://www.ibm.com/support/knowledgecenter/en/SS3JRN_7.2.1/com.ibm.itcama.doc_7.2.1/oracleextended/fac_oracle_codepage.html
> https://metacpan.org/release/libintl-perl

FTR, I think the official site to look up this info is here:

  https://www.iana.org/assignments/character-sets/character-sets.xhtml



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-25 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-24 15:39 [patch] add support for ibm278 Timo Myyrä
2020-12-24 18:56 ` Eli Zaretskii
2020-12-25 11:21   ` Timo Myyrä
2020-12-25 14:02     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.