ItgLvb / teamcity-telegram-plugin

TeamCity notifications for Telegram messenger
Apache License 2.0
7 stars 4 forks source link

Troubles with 6-digit numbers #5

Open damevanderjahr opened 3 years ago

damevanderjahr commented 3 years ago

Numbers such as 402637 converted to Unicode characters such as ☷.

It is caused by incorrect regex pattern in TelegramBotManager.java, line 189: Pattern p = Pattern.compile("(\\w[0x])([\\da-f]{4,5})", Pattern.CASE_INSENSITIVE);

I replaced it with Pattern p = Pattern.compile("(0x)([\\da-f]{4,5})", Pattern.CASE_INSENSITIVE);

and it perfectly works with TeamCity 2021.1.2. To send ☷ I can just print it as 0x2637 in FreeMarker template.

It might be helpful to fix this in the project code.

ItgLvb commented 3 years ago

Hi. I think you right. Сan you make a pull request?