mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
renamed ambiguous getBom to getPossibleBom
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ public class ExternalDiffToolUtil {
|
||||
|
||||
byte[] bytes = contentData.getBytes(charset);
|
||||
|
||||
byte[] bom = hasBom ? CharsetToolkit.getBom(charset) : null;
|
||||
byte[] bom = hasBom ? CharsetToolkit.getPossibleBom(charset) : null;
|
||||
if (bom != null) {
|
||||
bytes = ArrayUtil.mergeArrays(bom, bytes);
|
||||
}
|
||||
|
||||
@@ -624,8 +624,12 @@ public class CharsetToolkit {
|
||||
return CHARSET_TO_MANDATORY_BOM.get(charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BOM which can be associated with this charset, or null otherwise.
|
||||
* Currently these are UTF-16xx, UTF-32xx and UTF-8.
|
||||
*/
|
||||
@Nullable
|
||||
public static byte[] getBom(@NotNull Charset charset) {
|
||||
public static byte[] getPossibleBom(@NotNull Charset charset) {
|
||||
if (charset.equals(UTF8_CHARSET)) return UTF8_BOM;
|
||||
return CHARSET_TO_MANDATORY_BOM.get(charset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user