--- a/src/hotspot/share/utilities/utf8.hpp Thu Sep 20 18:39:53 2018 +0200
+++ b/src/hotspot/share/utilities/utf8.hpp Tue Sep 18 21:47:14 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -90,14 +90,14 @@
static bool is_latin1(jchar c);
// checks if the given string can be encoded as latin1
- static bool is_latin1(jchar* base, int length);
+ static bool is_latin1(const jchar* base, int length);
// returns the utf8 size of a unicode character
static int utf8_size(jchar c);
static int utf8_size(jbyte c);
// returns the utf8 length of a unicode string
- template<typename T> static int utf8_length(T* base, int length);
+ template<typename T> static int utf8_length(const T* base, int length);
// converts a unicode string to utf8 string
static void convert_to_utf8(const jchar* base, int length, char* utf8_buffer);
@@ -105,12 +105,12 @@
// converts a unicode string to a utf8 string; result is allocated
// in resource area unless a buffer is provided. The unicode 'length'
// parameter is set to the length of the result utf8 string.
- template<typename T> static char* as_utf8(T* base, int& length);
- static char* as_utf8(jchar* base, int length, char* buf, int buflen);
- static char* as_utf8(jbyte* base, int length, char* buf, int buflen);
+ template<typename T> static char* as_utf8(const T* base, int& length);
+ static char* as_utf8(const jchar* base, int length, char* buf, int buflen);
+ static char* as_utf8(const jbyte* base, int length, char* buf, int buflen);
// returns the quoted ascii length of a unicode string
- template<typename T> static int quoted_ascii_length(T* base, int length);
+ template<typename T> static int quoted_ascii_length(const T* base, int length);
// converts a unicode string to quoted ascii
template<typename T> static void as_quoted_ascii(const T* base, int length, char* buf, int buflen);