20#include <com/sun/star/i18n/UnicodeType.hpp>
21#include <com/sun/star/i18n/ScriptType.hpp>
26#include <unicode/numfmt.h>
27#include <unicode/uchar.h>
29#include <rtl/character.hxx>
40template<
class L,
typename T>
49 return (
type < UnicodeScript_kScriptCount &&
72 static sal_uInt32 c = 0x00;
73 static sal_uInt32 r = 0x00;
75 if (
ch == c)
return r;
78 switch (u_charType(
ch))
81 r = css::i18n::UnicodeType::UNASSIGNED;
83 case U_UPPERCASE_LETTER:
84 r = css::i18n::UnicodeType::UPPERCASE_LETTER;
86 case U_LOWERCASE_LETTER:
87 r = css::i18n::UnicodeType::LOWERCASE_LETTER;
89 case U_TITLECASE_LETTER:
90 r = css::i18n::UnicodeType::TITLECASE_LETTER;
92 case U_MODIFIER_LETTER:
93 r = css::i18n::UnicodeType::MODIFIER_LETTER;
96 r = css::i18n::UnicodeType::OTHER_LETTER;
98 case U_NON_SPACING_MARK:
99 r = css::i18n::UnicodeType::NON_SPACING_MARK;
101 case U_ENCLOSING_MARK:
102 r = css::i18n::UnicodeType::ENCLOSING_MARK;
104 case U_COMBINING_SPACING_MARK:
105 r = css::i18n::UnicodeType::COMBINING_SPACING_MARK;
107 case U_DECIMAL_DIGIT_NUMBER:
108 r = css::i18n::UnicodeType::DECIMAL_DIGIT_NUMBER;
110 case U_LETTER_NUMBER:
111 r = css::i18n::UnicodeType::LETTER_NUMBER;
114 r = css::i18n::UnicodeType::OTHER_NUMBER;
116 case U_SPACE_SEPARATOR:
117 r = css::i18n::UnicodeType::SPACE_SEPARATOR;
119 case U_LINE_SEPARATOR:
120 r = css::i18n::UnicodeType::LINE_SEPARATOR;
122 case U_PARAGRAPH_SEPARATOR:
123 r = css::i18n::UnicodeType::PARAGRAPH_SEPARATOR;
126 r = css::i18n::UnicodeType::CONTROL;
129 r = css::i18n::UnicodeType::FORMAT;
131 case U_PRIVATE_USE_CHAR:
132 r = css::i18n::UnicodeType::PRIVATE_USE;
135 r = css::i18n::UnicodeType::SURROGATE;
137 case U_DASH_PUNCTUATION:
138 r = css::i18n::UnicodeType::DASH_PUNCTUATION;
140 case U_INITIAL_PUNCTUATION:
141 r = css::i18n::UnicodeType::INITIAL_PUNCTUATION;
143 case U_FINAL_PUNCTUATION:
144 r = css::i18n::UnicodeType::FINAL_PUNCTUATION;
146 case U_CONNECTOR_PUNCTUATION:
147 r = css::i18n::UnicodeType::CONNECTOR_PUNCTUATION;
149 case U_OTHER_PUNCTUATION:
150 r = css::i18n::UnicodeType::OTHER_PUNCTUATION;
153 r = css::i18n::UnicodeType::MATH_SYMBOL;
155 case U_CURRENCY_SYMBOL:
156 r = css::i18n::UnicodeType::CURRENCY_SYMBOL;
158 case U_MODIFIER_SYMBOL:
159 r = css::i18n::UnicodeType::MODIFIER_SYMBOL;
162 r = css::i18n::UnicodeType::OTHER_SYMBOL;
164 case U_START_PUNCTUATION:
165 r = css::i18n::UnicodeType::START_PUNCTUATION;
167 case U_END_PUNCTUATION:
168 r = css::i18n::UnicodeType::END_PUNCTUATION;
180 if (
ch == c)
return r;
191 nChar = u_charMirror(nChar);
195#define bit(name) (1U << name)
197#define UPPERMASK bit(UnicodeType::UPPERCASE_LETTER)
199#define LOWERMASK bit(UnicodeType::LOWERCASE_LETTER)
201#define TITLEMASK bit(UnicodeType::TITLECASE_LETTER)
203#define ALPHAMASK UPPERMASK|LOWERMASK|TITLEMASK|\
204 bit(UnicodeType::MODIFIER_LETTER)|\
205 bit(UnicodeType::OTHER_LETTER)
207#define SPACEMASK bit(UnicodeType::SPACE_SEPARATOR)|\
208 bit(UnicodeType::LINE_SEPARATOR)|\
209 bit(UnicodeType::PARAGRAPH_SEPARATOR)
211#define CONTROLMASK bit(UnicodeType::CONTROL)|\
212 bit(UnicodeType::FORMAT)|\
213 bit(UnicodeType::LINE_SEPARATOR)|\
214 bit(UnicodeType::PARAGRAPH_SEPARATOR)
216#define IsType(func, mask) \
217bool func( const sal_uInt32 ch) {\
218 return (bit(getUnicodeType(ch)) & (mask)) != 0;\
225#define CONTROLSPACE bit(0x09)|bit(0x0a)|bit(0x0b)|bit(0x0c)|bit(0x0d)|\
226 bit(0x1c)|bit(0x1d)|bit(0x1e)|bit(0x1f)
239 case USCRIPT_INVALID_CODE:
241 case USCRIPT_INHERITED:
242 case USCRIPT_UNWRITTEN_LANGUAGES:
243 case USCRIPT_UNKNOWN:
244 case USCRIPT_MATHEMATICAL_NOTATION:
245 case USCRIPT_SYMBOLS:
246 case USCRIPT_CODE_LIMIT:
247 nRet = ScriptType::WEAK;
249 case USCRIPT_ARMENIAN:
250 case USCRIPT_CHEROKEE:
252 case USCRIPT_CYRILLIC:
253 case USCRIPT_GEORGIAN:
258 case USCRIPT_OLD_ITALIC:
260 case USCRIPT_CANADIAN_ABORIGINAL:
261 case USCRIPT_BRAILLE:
262 case USCRIPT_CYPRIOT:
263 case USCRIPT_OSMANYA:
264 case USCRIPT_SHAVIAN:
265 case USCRIPT_KATAKANA_OR_HIRAGANA:
266 case USCRIPT_GLAGOLITIC:
268 case USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC:
269 case USCRIPT_OLD_HUNGARIAN:
270 case USCRIPT_LATIN_FRAKTUR:
271 case USCRIPT_LATIN_GAELIC:
272 nRet = ScriptType::LATIN;
274 case USCRIPT_BOPOMOFO:
277 case USCRIPT_HIRAGANA:
278 case USCRIPT_KATAKANA:
280 case USCRIPT_SIMPLIFIED_HAN:
281 case USCRIPT_TRADITIONAL_HAN:
282 case USCRIPT_JAPANESE:
285 case USCRIPT_KHITAN_SMALL_SCRIPT:
286 nRet = ScriptType::ASIAN;
289 case USCRIPT_BENGALI:
290 case USCRIPT_DESERET:
291 case USCRIPT_DEVANAGARI:
292 case USCRIPT_ETHIOPIC:
293 case USCRIPT_GUJARATI:
294 case USCRIPT_GURMUKHI:
296 case USCRIPT_KANNADA:
299 case USCRIPT_MALAYALAM:
300 case USCRIPT_MONGOLIAN:
301 case USCRIPT_MYANMAR:
303 case USCRIPT_SINHALA:
309 case USCRIPT_TIBETAN:
310 case USCRIPT_TAGALOG:
311 case USCRIPT_HANUNOO:
313 case USCRIPT_TAGBANWA:
315 case USCRIPT_LINEAR_B:
317 case USCRIPT_UGARITIC:
318 case USCRIPT_BUGINESE:
319 case USCRIPT_KHAROSHTHI:
320 case USCRIPT_SYLOTI_NAGRI:
321 case USCRIPT_NEW_TAI_LUE:
322 case USCRIPT_TIFINAGH:
323 case USCRIPT_OLD_PERSIAN:
324 case USCRIPT_BALINESE:
326 case USCRIPT_BLISSYMBOLS:
329 case USCRIPT_DEMOTIC_EGYPTIAN:
330 case USCRIPT_HIERATIC_EGYPTIAN:
331 case USCRIPT_EGYPTIAN_HIEROGLYPHS:
332 case USCRIPT_KHUTSURI:
333 case USCRIPT_PAHAWH_HMONG:
334 case USCRIPT_HARAPPAN_INDUS:
335 case USCRIPT_JAVANESE:
336 case USCRIPT_KAYAH_LI:
338 case USCRIPT_LINEAR_A:
339 case USCRIPT_MANDAEAN:
340 case USCRIPT_MAYAN_HIEROGLYPHS:
341 case USCRIPT_MEROITIC:
344 case USCRIPT_OLD_PERMIC:
345 case USCRIPT_PHAGS_PA:
346 case USCRIPT_PHOENICIAN:
347 case USCRIPT_PHONETIC_POLLARD:
348 case USCRIPT_RONGORONGO:
350 case USCRIPT_ESTRANGELO_SYRIAC:
351 case USCRIPT_WESTERN_SYRIAC:
352 case USCRIPT_EASTERN_SYRIAC:
353 case USCRIPT_TENGWAR:
355 case USCRIPT_VISIBLE_SPEECH:
356 case USCRIPT_CUNEIFORM:
361 case USCRIPT_OL_CHIKI:
363 case USCRIPT_SAURASHTRA:
364 case USCRIPT_SIGN_WRITING:
365 case USCRIPT_SUNDANESE:
367 case USCRIPT_MEITEI_MAYEK:
368 case USCRIPT_IMPERIAL_ARAMAIC:
369 case USCRIPT_AVESTAN:
372 case USCRIPT_MANICHAEAN:
373 case USCRIPT_INSCRIPTIONAL_PAHLAVI:
374 case USCRIPT_PSALTER_PAHLAVI:
375 case USCRIPT_BOOK_PAHLAVI:
376 case USCRIPT_INSCRIPTIONAL_PARTHIAN:
377 case USCRIPT_SAMARITAN:
378 case USCRIPT_TAI_VIET:
381 case USCRIPT_NAKHI_GEBA:
382 case USCRIPT_OLD_SOUTH_ARABIAN:
383 case USCRIPT_BASSA_VAH:
384 case USCRIPT_DUPLOYAN_SHORTAND:
385 case USCRIPT_ELBASAN:
386 case USCRIPT_GRANTHA:
390 case USCRIPT_MEROITIC_CURSIVE:
391 case USCRIPT_OLD_NORTH_ARABIAN:
392 case USCRIPT_NABATAEAN:
393 case USCRIPT_PALMYRENE:
395 case USCRIPT_WARANG_CITI:
397 nRet = ScriptType::COMPLEX;
405 constexpr int32_t nBuf = 42;
406 UScriptCode
aBuf[nBuf];
409 aBuf[0] =
static_cast<UScriptCode
>(u_getPropertyValueEnum( UCHAR_SCRIPT,
419 UErrorCode status = U_ZERO_ERROR;
420 const int32_t nScripts = uscript_getCode(
422 aBuf, nBuf, &status);
425 if (nScripts == 0 || !U_SUCCESS(status))
426 return css::i18n::ScriptType::LATIN;
436 case USCRIPT_CODE_LIMIT:
437 case USCRIPT_INVALID_CODE:
441 case USCRIPT_INHERITED:
444 case USCRIPT_MATHEMATICAL_NOTATION:
445 case USCRIPT_SYMBOLS:
448 case USCRIPT_UNWRITTEN_LANGUAGES:
449 case USCRIPT_UNKNOWN:
455 case USCRIPT_ARMENIAN:
458 case USCRIPT_BENGALI:
461 case USCRIPT_BOPOMOFO:
464 case USCRIPT_CHEROKEE:
470 case USCRIPT_CYRILLIC:
473 case USCRIPT_DESERET:
476 case USCRIPT_DEVANAGARI:
479 case USCRIPT_ETHIOPIC:
482 case USCRIPT_GEORGIAN:
491 case USCRIPT_GUJARATI:
494 case USCRIPT_GURMUKHI:
506 case USCRIPT_HIRAGANA:
509 case USCRIPT_KANNADA:
512 case USCRIPT_KATAKANA:
524 case USCRIPT_MALAYALAM:
527 case USCRIPT_MONGOLIAN:
530 case USCRIPT_MYANMAR:
536 case USCRIPT_OLD_ITALIC:
545 case USCRIPT_SINHALA:
563 case USCRIPT_TIBETAN:
566 case USCRIPT_CANADIAN_ABORIGINAL:
572 case USCRIPT_TAGALOG:
575 case USCRIPT_HANUNOO:
581 case USCRIPT_TAGBANWA:
584 case USCRIPT_BRAILLE:
587 case USCRIPT_CYPRIOT:
593 case USCRIPT_LINEAR_B:
596 case USCRIPT_OSMANYA:
599 case USCRIPT_SHAVIAN:
605 case USCRIPT_UGARITIC:
608 case USCRIPT_KATAKANA_OR_HIRAGANA:
611 case USCRIPT_BUGINESE:
614 case USCRIPT_GLAGOLITIC:
617 case USCRIPT_KHAROSHTHI:
620 case USCRIPT_SYLOTI_NAGRI:
623 case USCRIPT_NEW_TAI_LUE:
626 case USCRIPT_TIFINAGH:
629 case USCRIPT_OLD_PERSIAN:
632 case USCRIPT_BALINESE:
638 case USCRIPT_BLISSYMBOLS:
650 case USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC:
653 case USCRIPT_DEMOTIC_EGYPTIAN:
654 case USCRIPT_HIERATIC_EGYPTIAN:
655 case USCRIPT_EGYPTIAN_HIEROGLYPHS:
658 case USCRIPT_KHUTSURI:
661 case USCRIPT_SIMPLIFIED_HAN:
664 case USCRIPT_TRADITIONAL_HAN:
667 case USCRIPT_PAHAWH_HMONG:
670 case USCRIPT_OLD_HUNGARIAN:
673 case USCRIPT_HARAPPAN_INDUS:
676 case USCRIPT_JAVANESE:
679 case USCRIPT_KAYAH_LI:
682 case USCRIPT_LATIN_FRAKTUR:
685 case USCRIPT_LATIN_GAELIC:
691 case USCRIPT_LINEAR_A:
694 case USCRIPT_MAYAN_HIEROGLYPHS:
697 case USCRIPT_MEROITIC:
706 case USCRIPT_OLD_PERMIC:
709 case USCRIPT_PHAGS_PA:
712 case USCRIPT_PHOENICIAN:
715 case USCRIPT_PHONETIC_POLLARD:
718 case USCRIPT_RONGORONGO:
724 case USCRIPT_ESTRANGELO_SYRIAC:
727 case USCRIPT_WESTERN_SYRIAC:
730 case USCRIPT_EASTERN_SYRIAC:
733 case USCRIPT_TENGWAR:
739 case USCRIPT_VISIBLE_SPEECH:
742 case USCRIPT_CUNEIFORM:
748 case USCRIPT_JAPANESE:
760 case USCRIPT_OL_CHIKI:
766 case USCRIPT_SAURASHTRA:
769 case USCRIPT_SIGN_WRITING:
772 case USCRIPT_SUNDANESE:
778 case USCRIPT_MEITEI_MAYEK:
781 case USCRIPT_IMPERIAL_ARAMAIC:
784 case USCRIPT_AVESTAN:
796 case USCRIPT_MANICHAEAN:
799 case USCRIPT_INSCRIPTIONAL_PAHLAVI:
800 case USCRIPT_PSALTER_PAHLAVI:
801 case USCRIPT_BOOK_PAHLAVI:
802 case USCRIPT_INSCRIPTIONAL_PARTHIAN:
805 case USCRIPT_SAMARITAN:
808 case USCRIPT_TAI_VIET:
811 case USCRIPT_MANDAEAN:
814 case USCRIPT_NABATAEAN:
817 case USCRIPT_PALMYRENE:
826 case USCRIPT_NAKHI_GEBA:
829 case USCRIPT_OLD_SOUTH_ARABIAN:
832 case USCRIPT_BASSA_VAH:
835 case USCRIPT_DUPLOYAN_SHORTAND:
838 case USCRIPT_ELBASAN:
841 case USCRIPT_GRANTHA:
853 case USCRIPT_MEROITIC_CURSIVE:
856 case USCRIPT_OLD_NORTH_ARABIAN:
862 case USCRIPT_WARANG_CITI:
868 case USCRIPT_JURCHEN:
877 case USCRIPT_SHARADA:
880 case USCRIPT_SORA_SOMPENG:
892 case USCRIPT_ANATOLIAN_HIEROGLYPHS:
898 case USCRIPT_TIRHUTA:
901 case USCRIPT_CAUCASIAN_ALBANIAN:
904 case USCRIPT_MAHAJANI:
916 case USCRIPT_MULTANI:
919 case USCRIPT_PAU_CIN_HAU:
922 case USCRIPT_SIDDHAM:
928 case USCRIPT_BHAIKSUKI:
931 case USCRIPT_MARCHEN:
940 case USCRIPT_HAN_WITH_BOPOMOFO:
946 case USCRIPT_SYMBOLS_EMOJI:
949 case USCRIPT_MASARAM_GONDI:
952 case USCRIPT_SOYOMBO:
955 case USCRIPT_ZANABAZAR_SQUARE:
961 case USCRIPT_GUNJALA_GONDI:
964 case USCRIPT_MAKASAR:
967 case USCRIPT_MEDEFAIDRIN:
970 case USCRIPT_HANIFI_ROHINGYA:
973 case USCRIPT_SOGDIAN:
976 case USCRIPT_OLD_SOGDIAN:
979 case USCRIPT_ELYMAIC:
982 case USCRIPT_NYIAKENG_PUACHUE_HMONG:
985 case USCRIPT_NANDINAGARI:
991 case USCRIPT_CHORASMIAN:
994 case USCRIPT_DIVES_AKURU:
997 case USCRIPT_KHITAN_SMALL_SCRIPT:
1000 case USCRIPT_YEZIDI:
1003#if (U_ICU_VERSION_MAJOR_NUM >= 70)
1004 case USCRIPT_CYPRO_MINOAN:
1007 case USCRIPT_OLD_UYGHUR:
1010 case USCRIPT_TANGSA:
1016 case USCRIPT_VITHKUQI:
1020#if (U_ICU_VERSION_MAJOR_NUM >= 72)
1024 case USCRIPT_NAG_MUNDARI:
1038 UErrorCode errorCode=U_ZERO_ERROR;
1047 aLangTag.
reset(
"fr-FR");
1051 std::unique_ptr<icu::NumberFormat> xF(
1052 icu::NumberFormat::createPercentInstance(aLocale, errorCode));
1053 if(U_FAILURE(errorCode))
1055 SAL_WARN(
"i18n",
"icu::NumberFormat::createPercentInstance failed");
1056 return OUString::number(dNumber) +
"%";
1059 icu::UnicodeString output;
1060 xF->format(dNumber/100, output);
1061 OUString aRet(
reinterpret_cast<const sal_Unicode *
>(output.getBuffer()),
1066 return aRet.replace(0x00A0, 0x202F);
1074 if(
maInput.getLength() > 255 )
1080 bool bPreventNonHex =
false;
1081 if(
maInput.indexOf(
"U+") != -1 )
1082 bPreventNonHex =
true;
1086 case css::i18n::UnicodeType::SURROGATE:
1087 if( bPreventNonHex )
1093 if( rtl::isLowSurrogate(uChar) &&
maUtf16.isEmpty() &&
maInput.isEmpty() )
1098 if( rtl::isHighSurrogate(uChar) &&
maInput.isEmpty() )
1108 case css::i18n::UnicodeType::NON_SPACING_MARK:
1109 case css::i18n::UnicodeType::COMBINING_SPACING_MARK:
1110 if( bPreventNonHex )
1168 if( !bPreventNonHex )
1169 maInput.insertUtf32(0, uChar);
1177 else if ( !
maInput.isEmpty() )
1183 if( !bPreventNonHex )
1184 maInput.insertUtf32(0, uChar);
1192 else if(
maInput.indexOf(
"U+") == -1 &&
maInput.getLength() == 8 )
1195 else if(
maInput.indexOf(
"U+") == 8 )
1198 else if( rtl::isAsciiHexDigit(uChar) )
1201 maInput.insertUtf32(0, uChar);
1208 maInput.insertUtf32(0, uChar);
1238 sal_uInt32 nUnicode = 0;
1239 sal_Int32 nUPlus =
maInput.indexOf(
"U+");
1244 sIn =
maInput.copy(2).makeStringAndClear();
1245 nUPlus = sIn.indexOf(
"U+");
1249 while( nUPlus != -1 )
1253 if( !rtl::isUnicodeCodePoint(nUnicode) || nUnicode < 0x20 )
1254 maInput = sIn.subView(nUPlus);
1255 sIn = sIn.copy(nUPlus+2);
1256 nUPlus = sIn.indexOf(
"U+");
1259 nUnicode = sIn.toUInt32(16);
1260 if( !rtl::isUnicodeCodePoint(nUnicode) || nUnicode < 0x20 )
1261 maInput.truncate().append( sIn[sIn.getLength()-1] );
1269 sal_uInt32 counter = 0;
1270 while(
nPos < sIn.getLength() )
1272 sIn.iterateCodePoints(&
nPos);
1281 OUStringBuffer output =
"";
1282 sal_Int32 nUPlus = sIn.indexOf(
"U+");
1284 if( nUPlus != -1 || (sIn.getLength() > 1 &&
mbIsHexString) )
1286 sal_uInt32 nUnicode = 0;
1290 nUPlus = sIn.indexOf(
"U+");
1295 output.appendUtf32( nUnicode );
1297 sIn = sIn.copy(nUPlus+2);
1298 nUPlus = sIn.indexOf(
"U+");
1300 nUnicode = sIn.toUInt32(16);
1301 output.appendUtf32( nUnicode );
1307 while(
nPos < sIn.getLength() )
1309 OUStringBuffer aTmp = OUString::number(sIn.iterateCodePoints(&
nPos),16);
1311 for( sal_Int32
i = 4 - aTmp.getLength();
i > 0; --
i )
1312 aTmp.insert( 0,
"0" );
1313 output.append(
"U+" + aTmp );
1316 return output.makeStringAndClear();
static icu::Locale getIcuLocale(const LanguageTag &rLanguageTag)
OUString getLanguage() const
OUString getScript() const
OUString getCountry() const
LanguageTag & reset(const OUString &rBcp47LanguageTag)
OUString ReplacementString()
bool AllowMoreInput(sal_Unicode uChar)
Build an input string of valid UTF16 units to toggle.
OUString StringToReplace()
Validates (and potentially modifies) the input string.
sal_uInt32 CharsToDelete()
While sInput.getLength() returns the number of utf16 units to delete, this function returns the numbe...
OUStringBuffer maCombining
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
static bool isWhiteSpace(const sal_uInt32 ch)
static sal_uInt32 GetMirroredChar(sal_uInt32)
static sal_uInt8 getUnicodeDirection(const sal_Unicode ch)
static sal_Int16 getUnicodeScriptType(const sal_Unicode ch, const ScriptTypeList *typeList, sal_Int16 unknownType=0)
static bool isSpace(const sal_uInt32 ch)
static sal_Int16 getScriptClassFromUScriptCode(UScriptCode eScript)
static sal_Unicode getUnicodeScriptStart(css::i18n::UnicodeScript type)
static sal_Int16 getScriptClassFromLanguageTag(const LanguageTag &rLanguageTag)
Map a LanguageTag's language ISO 639 code or script ISO 15924 code or language-script or locale to La...
static bool isAlpha(const sal_uInt32 ch)
static OString getExemplarLanguageForUScriptCode(UScriptCode eScript)
static sal_Int16 getUnicodeType(const sal_uInt32 ch)
static bool isControl(const sal_uInt32 ch)
static sal_Unicode getUnicodeScriptEnd(css::i18n::UnicodeScript type)
#define SAL_WARN(area, stream)
ScriptTypeList const typeList[]
sal_uInt32 toUInt32(std::u16string_view str, sal_Int16 radix=10)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
css::i18n::UnicodeScript to
#define IsType(func, mask)
static T getScriptType(const sal_Unicode ch, const L *typeList, T unknownType)
const sal_Int8 UnicodeDirectionBlockValue[]
#define UnicodeScriptTypeFrom
const sal_Int8 UnicodeDirectionIndex[]
const sal_Unicode UnicodeScriptType[][2]
const sal_Int8 UnicodeDirectionValue[]
#define UnicodeScriptTypeTo
#define UnicodeDirectionNumberBlock