1 /* |
1 /* |
2 * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
|
24 |
|
25 #ifndef SHARE_VM_UTILITIES_UTF8_HPP |
|
26 #define SHARE_VM_UTILITIES_UTF8_HPP |
|
27 |
|
28 #include "memory/allocation.hpp" |
|
29 #include "utilities/top.hpp" |
24 |
30 |
25 // Low-level interface for UTF8 strings |
31 // Low-level interface for UTF8 strings |
26 |
32 |
27 class UTF8 : AllStatic { |
33 class UTF8 : AllStatic { |
28 public: |
34 public: |
72 // converts a unicode string to a utf8 string; result is allocated |
78 // converts a unicode string to a utf8 string; result is allocated |
73 // in resource area unless a buffer is provided. |
79 // in resource area unless a buffer is provided. |
74 static char* as_utf8(jchar* base, int length); |
80 static char* as_utf8(jchar* base, int length); |
75 static char* as_utf8(jchar* base, int length, char* buf, int buflen); |
81 static char* as_utf8(jchar* base, int length, char* buf, int buflen); |
76 }; |
82 }; |
|
83 |
|
84 #endif // SHARE_VM_UTILITIES_UTF8_HPP |