diff --git a/CHANGELOG.md b/CHANGELOG.md index 817504f9..0287bb8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [2.5.4] - 2019-01-09 + +### Fixed + - Normalization of strings that failed to decompose under certain conditions (#106) +- Throw only on errors, not on errorcode that has `WARNING` in name if `throwOnWarnings == false` ## [2.5.3] - 2018-12-17 diff --git a/source/icu.net/ErrorCode.cs b/source/icu.net/ErrorCode.cs index e15747dd..20fa59d2 100644 --- a/source/icu.net/ErrorCode.cs +++ b/source/icu.net/ErrorCode.cs @@ -392,36 +392,44 @@ private static void ThrowIfError(ErrorCode e, string extraInfo, bool throwOnWarn break; case ErrorCode.USING_FALLBACK_WARNING: if (throwOnWarnings) - { throw new WarningException("Warning: A resource bundle lookup returned a fallback result " + extraInfo); - } + break; case ErrorCode.USING_DEFAULT_WARNING: if (throwOnWarnings) - { throw new WarningException("Warning: A resource bundle lookup returned a result from the root locale " + extraInfo); - } + break; case ErrorCode.SAFECLONE_ALLOCATED_WARNING: if (throwOnWarnings) - { throw new WarningException("Notice: A SafeClone operation required allocating memory " + extraInfo); - } + break; case ErrorCode.STATE_OLD_WARNING: - throw new WarningException("ICU has to use compatibility layer to construct the service. Expect performance/memory usage degradation. Consider upgrading " + extraInfo); + if (throwOnWarnings) + throw new WarningException("ICU has to use compatibility layer to construct the service. Expect performance/memory usage degradation. Consider upgrading " + extraInfo); + + break; case ErrorCode.STRING_NOT_TERMINATED_WARNING: - throw new WarningException("An output string could not be NUL-terminated because output length==destCapacity. " + extraInfo); + if (throwOnWarnings) + throw new WarningException("An output string could not be NUL-terminated because output length==destCapacity. " + extraInfo); + + break; case ErrorCode.SORT_KEY_TOO_SHORT_WARNING: - throw new WarningException("Number of levels requested in getBound is higher than the number of levels in the sort key " + extraInfo); + if (throwOnWarnings) + throw new WarningException("Number of levels requested in getBound is higher than the number of levels in the sort key " + extraInfo); + + break; case ErrorCode.AMBIGUOUS_ALIAS_WARNING: - throw new WarningException("This converter alias can go to different converter implementations " + extraInfo); + if (throwOnWarnings) + throw new WarningException("This converter alias can go to different converter implementations " + extraInfo); + + break; case ErrorCode.DIFFERENT_UCA_VERSION: if (throwOnWarnings) - { throw new WarningException( "Warning: ucol_open encountered a mismatch between UCA version and collator image version, so the collator was constructed from rules. No impact to further function " + extraInfo); - } + break; case ErrorCode.ILLEGAL_ARGUMENT_ERROR: throw new ArgumentException(extraInfo); diff --git a/source/icu.net/icu.net.csproj b/source/icu.net/icu.net.csproj index 70a8cb6b..a2e13334 100644 --- a/source/icu.net/icu.net.csproj +++ b/source/icu.net/icu.net.csproj @@ -11,7 +11,7 @@ SIL International MIT https://github.com/sillsdev/icu-dotnet - Copyright © 2007-2018 SIL International + Copyright © 2007-2019 SIL International icu.net is a C# Wrapper around ICU4C This version of icu.net works with (more or less) any version of ICU4C.