This is not supported right out of the box in the BB API.
BlackBerry supports the following character encodings:
- "ISO-8859-1"
- "UTF-8"
- "UTF-16BE"
- "US-ASCII"
However if you have an array of bytes and you know this is a string encoded in cp1251, then you may manually create a String
from it using smth like this:
StringBuffer sb = new StringBuffer();
char c;
for (int i = 0; i < mybyteArr.length; i++) {
c = getUnicodeCharForCP1251(mybyteArr[i]);
sb.append(c);
}
private char getUnicodeCharForCP1251(byte b) {
// return a matching unicode char for the argument
// using the table from http://en.wikipedia.org/wiki/Windows-1251
}