Calc/Features/JIS and ASC functions

From Apache OpenOffice Wiki
< Calc‎ | Features
Jump to: navigation, search

JIS and ASC Spreadsheet Functions

Specification Status
Author Eike Rathke
Last Change 2007-07-25
Status Standard, implemented in CWS dr54, updated in CWS calc43

Abstract

The ASC function converts full-width to half-width ASCII and katakana characters.

The JIS function converts half-width to full-width ASCII and katakana characters.

Both functions are needed for interoperability with Japanese localized Microsoft Excel versions.

References

Reference Document Check Location (URL)
Specification Process Entry Check passed n/a
Product Requirement, RFE, Issue ID (required) available i70213
Product Concept Document not available
Test case specification (required) available .xls document attached to i70213
IDL Specification not available
Software Specification Rules n/a n/a
Other, e.g. references to related specs n/a

Contacts

Role Name E-Mail Address
Developer Eike Rathke <er@openoffice.org>
Quality Assurance Frank Stecher <fst@openoffice.org>
Documentation Uwe Fischer <ufi@openoffice.org>
User Experience n/a n/a

Acronyms and Abbreviations

Acronym / Abbreviation Definition
ASCII American Standard Code for Information Interchange
JIS Japanese Industrial Standard

Detailed Specification

JIS

Summary: Converts half-width to full-width ASCII and katakana characters.

Syntax: JIS( Text T )

Returns: Text

Constraints: None

Semantics: Conversion is done for half-width ASCII and katakana characters, some characters are converted in a special way, see table below. Other characters are simply copied from T to the result. This is the complementary function to ASC.

A followed by means that there are two consecutive characters to convert from.

From Unicode Character (c)

To Unicode Character

Comment

0x0022

0x201d

QUOTATION MARK => RIGHT DOUBLE QUOTATION MARK
This is an exception to the ASCII range that follows below.

0x005c

0xffe5

REVERSE SOLIDUS "\" => FULLWIDTH YEN SIGN
(code-page 932 legacy, for details see ASC function)
This is an exception to the ASCII range that follows below.

0x0060

0x2018

GRAVE ACCENT => LEFT SINGLE QUOTATION MARK
This is an exception to the ASCII range that follows below.

0x0027

0x2019

APOSTROPHE => RIGHT SINGLE QUOTATION MARK
This is an exception to the ASCII range that follows below.

0x0021 <= c <= 0x007e

c - 0x0021 + 0xff01

ASCII characters

0xff66

0x30f2

katakana wo

0xff67 <= c <= 0xff6b

(c - 0xff67) * 2 + 0x30a1

katakana small a-o

0xff6c <= c <= 0xff6e

(c - 0xff6c) * 2 + 0x30e3

katakana small ya-yo

0xff6f

0x30c3

katakana small tsu

0xff71 <= c <= 0xff75

(c - 0xff71) * 2 + 0x30a2

katakana a-o

0xff76 <= c <= 0xff81
followed by 0xff9e

(c - 0xff76) * 2 + 0x30ac

katakana ga-dsu

0xff76 <= c <= 0xff81
not followed by 0xff9e

(c - 0xff76) * 2 + 0x30ab

katakana ka-chi

0xff82 <= c <= 0xff84
followed by 0xff9e

(c - 0xff82) * 2 + 0x30c5

katakana du-do

0xff82 <= c <= 0xff84
not followed by 0xff9e

(c - 0xff82) * 2 + 0x30c4

katakana tsu-to

0xff85 <= c <= 0xff89

c - 0xff85 + 0x30ca

katakana na-no

0xff8a <= c <= 0xff8e
followed by 0xff9e

(c - 0xff8a) * 3 + 0x30d0

katakana ba-bo

0xff8a <= c <= 0xff8e
followed by 0xff9f

(c - 0xff8a) * 3 + 0x30d1

katakana pa-po

0xff8a <= c <= 0xff8e
neither followed by 0xff9e nor 0xff9f

(c - 0xff8a) * 3 + 0x30cf

katakana ha-ho

0xff8f <= c <= 0xff93

c - 0xff8f + 0x30de

katakana ma-mo

0xff94 <= c <= 0xff96

(c - 0xff94) * 2 + 0x30e4

katakana ya-yo

0xff97 <= c <= 0xff9b

c - 0xff97 + 0x30e9

katakana ra-ro

0xff9c

0x30ef

katakana wa

0xff9d

0x30f3

katakana nn

0xff9e

0x309b

HALFWIDTH KATAKANA VOICED SOUND MARK => FULLWIDTH

0xff9f

0x309c

HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK => FULLWIDTH

0xff70

0x30fc

HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK => FULLWIDTH

0xff61

0x3002

HALFWIDTH IDEOGRAPHIC FULL STOP => FULLWIDTH

0xff62

0x300c

HALFWIDTH LEFT CORNER BRACKET => FULLWIDTH

0xff63

0x300d

HALFWIDTH RIGHT CORNER BRACKET => FULLWIDTH

0xff64

0x3001

HALFWIDTH IDEOGRAPHIC COMMA => FULLWIDTH

0xff65

0x30fb

HALFWIDTH KATAKANA MIDDLE DOT => FULLWIDTH

ASC

Summary: Converts full-width to half-width ASCII and katakana characters.

Syntax: ASC( Text T )

Returns: Text

Constraints: None

Semantics: Conversion is done for full-width ASCII and katakana characters, some characters are converted in a special way, see table below. Other characters are simply copied from T to the result. This is the complementary function to JIS.

The percent sign % in the conversion table below denotes the modulo operation. A followed by means that a character is converted to two consecutive characters.

From Unicode Character (c)

To Unicode Character

Comment

0x30a1 <= c <= 0x30aa
if c%2==0

(c - 0x30a2) / 2 + 0xff71

katakana a-o

0x30a1 <= c <= 0x30aa
if c%2==1

(c - 0x30a1) / 2 + 0xff67

katakana small a-o

0x30ab <= c <= 0x30c2
if c%2==1

(c - 0x30ab) / 2 + 0xff76

katakana ka-chi

0x30ab <= c <= 0x30c2
if c%2==0

(c - 0x30ac) / 2 + 0xff76
followed by 0xff9e

katakana ga-dhi

0x30c3

0xff6f

katakana small tsu

0x30c4 <= c <= 0x30c9
if c%2==0

(c - 0x30c4) / 2 + 0xff82

katakana tsu-to

0x30c4 <= c <= 0x30c9
if c%2==1

(c - 0x30c5) / 2 + 0xff82
followed by 0xff9e

katakana du-do

0x30ca <= c <= 0x30ce

c - 0x30ca + 0xff85

katakana na-no

0x30cf <= c <= 0x30dd
if c%3==0

(c - 0x30cf) / 3 + 0xff8a

katakana ha-ho

0x30cf <= c <= 0x30dd
if c%3==1

(c - 0x30d0) / 3 + 0xff8a
followed by 0xff9e

katakana ba-bo

0x30cf <= c <= 0x30dd
if c%3==2

(c - 0x30d1) / 3 + 0xff8a
followed by 0xff9f

katakana pa-po

0x30de <= c <= 0x30e2

c - 0x30de + 0xff8f

katakana ma-mo

0x30e3 <= c <= 0x30e8
if c%2==0

(c - 0x30e4) / 2 + 0xff94)

katakana ya-yo

0x30e3 <= c <= 0x30e8
if c%2==1

(c - 0x30e3) / 2 + 0xff6c

katakana small ya-yo

0x30e9 <= c <= 0x30ed

c - 0x30e9 + 0xff97

katakana ra-ro

0x30ef

0xff9c

katakana wa

0x30f2

0xff66

katakana wo

0x30f3

0xff9d

katakana nn

0xff01 <= c <= 0xff5e

c - 0xff01 + 0x0021

ASCII characters

0x2015

0xff70

HORIZONTAL BAR => HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK

0x2018

0x0060

LEFT SINGLE QUOTATION MARK => GRAVE ACCENT

0x2019

0x0027

RIGHT SINGLE QUOTATION MARK => APOSTROPHE

0x201d

0x0022

RIGHT DOUBLE QUOTATION MARK => QUOTATION MARK

0x3001

0xff64

IDEOGRAPHIC COMMA

0x3002

0xff61

IDEOGRAPHIC FULL STOP

0x300c

0xff62

LEFT CORNER BRACKET

0x300d

0xff63

RIGHT CORNER BRACKET

0x309b

0xff9e

KATAKANA-HIRAGANA VOICED SOUND MARK

0x309c

0xff9f

KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK

0x30fb

0xff65

KATAKANA MIDDLE DOT

0x30fc

0xff70

KATAKANA-HIRAGANA PROLONGED SOUND MARK

0xffe5

0x005c

FULLWIDTH YEN SIGN => REVERSE SOLIDUS "\"

The REVERSE SOLIDUS "\" (aka backslash) is a specialty that gets displayed as a Yen sign with some Japanese fonts, which is a legacy of code-page 932, see
http://www.microsoft.com/globaldev/DrIntl/columns/019/default.mspx#EED
http://www.microsoft.com/globaldev/reference/dbcs/932.htm

related references

For references regarding halfwidth and fullwidth characters see
http://www.unicode.org/reports/tr11/
http://www.unicode.org/charts/charindex2.html#H
http://www.unicode.org/charts/charindex2.html#F

For information about the mapping of JIS X 0201 and JIS X 0208 to Unicode characters see
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0208.TXT


Migration

No migration, previous versions of OOo didn't have JIS and ASC functions.

Configuration

No configuration involved.

File Format

No file format changes.

Open Issues

None.

Personal tools