ICU build, regexp and UTF-8 BOM

Previously we have added a warning that in ICU builds regexps only work on Unicode buffers. Does the buffer have to be exactly UTF-8 or it can be UCS, with BOM, etc. but still Unicode?