Skip to content

Commit

Permalink
0.8.0.3 Added support for ICU 72 (fixes #94)
Browse files Browse the repository at this point in the history
  • Loading branch information
vshabanov committed Oct 1, 2023
1 parent e2198ff commit b7574cc
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
18 changes: 18 additions & 0 deletions Data/Text/ICU/Char.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ data BlockCode =
| Vithkuqi
| ZnamennyMusicalNotation

-- New blocks in Unicode 15.0 (ICU 72)

| ArabicExtendedC
| CjkUnifiedIdeographsExtensionH
| CyrillicExtendedD
| DevanagariExtendedA
| KaktovikNumerals
| Kawi
| NagMundari

deriving (Eq, Enum, Bounded, Show, Typeable)

instance NFData BlockCode where
Expand Down Expand Up @@ -618,6 +628,14 @@ data Bool_ =
| RegionalIndicator
| PrependedConcatenationMark
| ExtendedPictographic
-- ICU 70
| BasicEmoji -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| EmojiKeycapSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmojiModifierSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmojiFlagSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmojiTagSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmojiZwjSequence -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
| RgiEmoji -- ^ See https://www.unicode.org/reports/tr51/#Emoji_Sets
deriving (Eq, Enum, Show, Typeable)

instance NFData Bool_ where
Expand Down
9 changes: 9 additions & 0 deletions Data/Text/ICU/DateFormatter.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module Data.Text.ICU.DateFormatter
(DateFormatter, FormatStyle(..), DateFormatSymbolType(..), standardDateFormatter, patternDateFormatter, dateSymbols, formatCalendar
) where

#include <unicode/uvernum.h>
#include <unicode/udat.h>

import Control.Monad (forM)
Expand Down Expand Up @@ -89,6 +90,10 @@ data DateFormatSymbolType =
| ZodiacNamesWide -- ^ Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not supported for UDAT_ZODIAC_NAMES_WIDE)
| ZodiacNamesAbbreviated -- ^ Calendar zodiac names (only supported for some calendars, and only for FORMAT usage)
| ZodiacNamesNarrow -- ^ Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; udat_setSymbols not supported for UDAT_ZODIAC_NAMES_NARROW)
#if U_ICU_VERSION_MAJOR_NUM >= 70
| NarrowQuarters -- ^ The narrow quarter names, for example 1.
| StandaloneNarrowQuarters -- ^ The narrow standalone quarter names, for example 1.
#endif

toUDateFormatSymbolType :: DateFormatSymbolType -> CInt
toUDateFormatSymbolType Eras = #const UDAT_ERAS
Expand Down Expand Up @@ -116,6 +121,10 @@ toUDateFormatSymbolType CyclicYearsNarrow = #const UDAT_CYCLIC_YEARS_NARROW
toUDateFormatSymbolType ZodiacNamesWide = #const UDAT_ZODIAC_NAMES_WIDE
toUDateFormatSymbolType ZodiacNamesAbbreviated = #const UDAT_ZODIAC_NAMES_ABBREVIATED
toUDateFormatSymbolType ZodiacNamesNarrow = #const UDAT_ZODIAC_NAMES_NARROW
#if U_ICU_VERSION_MAJOR_NUM >= 70
toUDateFormatSymbolType NarrowQuarters = #const UDAT_NARROW_QUARTERS
toUDateFormatSymbolType StandaloneNarrowQuarters = #const UDAT_STANDALONE_NARROW_QUARTERS
#endif

type UDateFormatStyle = CInt
type UFieldPosition = CInt
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ following commands give up-to-date system dependencies for

Upstream ICU occasionally introduces backwards-incompatible API
breaks. This package tries to stay up to date with upstream, and is
currently more or less in sync with ICU 70.
currently more or less in sync with ICU 72.

Minimum required version is ICU 62.

Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.8.0.3

* Support for ICU 72 (#94)

0.8.0.2

* Support for creating a collator from custom rules (#76)
Expand Down
3 changes: 2 additions & 1 deletion tests/Properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ testCases =
,(I.unfold I.group <$> I.findAll "[abc]+" "xx b yy ac") ~?= [["b"],["ac"]]
,I.toUpper (Locale "de-DE") "ß" ~?= "SS"
,I.toCaseFold False "flag" ~?= "flag"
,I.blockCode '\x1FA50' ~?= I.ChessSymbols
,map I.blockCode ['\x1FA50', '\203257', '\73494'] ~?=
[I.ChessSymbols, I.CjkUnifiedIdeographsExtensionH, I.Kawi]
,I.direction '\x2068' ~?= I.FirstStrongIsolate
,I.getSkeleton I.spoof Nothing "\1089\1072t" ~?= "cat"
,S.shapeArabic [S.LettersShape] (nosp "ا ب ت ث") ~?= (nosp "ﺍ ﺑ ﺘ ﺚ")
Expand Down
2 changes: 1 addition & 1 deletion text-icu.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 1.18
-- 1.18 introduced extra-doc-files
name: text-icu
version: 0.8.0.2
version: 0.8.0.3
synopsis: Bindings to the ICU library
homepage: https://github.com/haskell/text-icu
bug-reports: https://github.com/haskell/text-icu/issues
Expand Down

0 comments on commit b7574cc

Please sign in to comment.