ExportDisplay show encoding

My task is to export VCF (stored in a string file.getValue()) In windows I need 1251 charset but string is in UTF-8. I’ve tried:

String utf8String;
String ansiString = file.getValue();//in case try fails at least utf8 will be as out
try {
	utf8String = new String(file.getValue().getBytes(), "UTF-8");
	ansiString = new String(utf8String.getBytes("UTF-8"), "windows-1251");
} catch (UnsupportedEncodingException e) {
	throw new RuntimeException("Error while reEncoding", e);

exportDisplay.show(new ByteArrayDataProvider(ansiString.getBytes()),
		file.getKey(), ExportFormat.OCTET_STREAM);

But for examle ‘file’ contained “Ф И О” I get “В¤ Р пїЅ Р С›” in the resulting file. How do I correctly triger saving file in win-1251 if original string(file.getValue() which is file content) was in utf-8?
PS: in non-windows platforms the following code works and perfectly saves file in utf8

exportDisplay.show(new ByteArrayDataProvider(file.getValue().getBytes()
				), file.getKey(), ExportFormat.OCTET_STREAM);

but I need to save file in cp1251

So I found the solution The key here is:
First of: if you’ve got a String object, then it no longer has an encoding, it’s a pure Unicode string(*)!

In Java, encodings are used only when you convert from bytes (byte[]) to a string (String) or vice versa. (You could theoretically do a direct conversion from byte[] to byte[] but I’ve yet to see that done in Java).
So he solution is simple

try {
		new ByteArrayDataProvider(file.getValue().getBytes("windows-1251")),
		file.getKey(), ExportFormat.OCTET_STREAM
} catch (UnsupportedEncodingException e) {
    throw new RuntimeException("Error while reEncoding", e);

You may delete this topic/question if it’s too stupid…