summaryrefslogtreecommitdiff
path: root/core/java/android/util/CharsetUtils.java
Commit message (Collapse)AuthorAgeFilesLines
* Consistent handling of modified UTF-8.Jeff Sharkey2020-11-131-11/+25
| | | | | | | | | | | | | | | | A recent set of patches had mismatched handling of UTF-8 vs modified UTF-8; this change converges all paths towards using modified UTF-8 to match the DataInput/Output API contract. New tests verify that underlying raw data is compatible between the upstream and local implementations. Bug: 171832118 Test: atest FrameworksCoreTests:android.util.CharsetUtilsTest Test: atest FrameworksCoreTests:android.util.XmlTest Test: atest FrameworksCoreTests:android.util.BinaryXmlTest Test: atest FrameworksCoreTests:com.android.internal.util.FastDataTest Change-Id: I49423edc867839fb6626cd8bd361abe7bc512633
* CharsetUtils alternatives that avoid allocations.Jeff Sharkey2020-11-091-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | Internally String.getBytes() calls libcore.util.CharsetUtils methods for a handful of common charsets, but that path requires new memory allocations for every call. This change introduces alternative versions of those methods which attempt to encode data directly into an already-allocated memory region. If the destination is to small, callers can detect and pivot back to calling String.getBytes(). The included benchmarks reveal these raw performance improvements, in addition to the reduced GC load which is harder to measure: timeLocal_LargeBuffer[simple]_mean: 424 timeLocal_SmallBuffer[simple]_mean: 511 timeUpstream[simple]_mean: 800 timeLocal_LargeBuffer[complex]_mean: 977 timeLocal_SmallBuffer[complex]_mean: 1266 timeUpstream[complex]_mean: 1468 Bug: 171832118 Test: atest CorePerfTests:android.util.CharsetUtilsPerfTest Test: atest FrameworksCoreTests:android.util.CharsetUtilsTest Change-Id: Iac1151e7cb8e88bf82339cada64b0936e1a7578b
* Remove dead code.Elliott Hughes2013-09-241-198/+0
| | | | | | | This hasn't been used since at least 2011, and we're no longer shipping the data supporting it either. Change-Id: Ibe42057650b49794c65d6f0d54ed7a492f3b594b
* Add KDDI/Softbank to available Shift_Jis mapping.Daisuke Miyakawa2010-05-251-23/+47
| | | | | Bug: 2689523 Change-Id: I5140bd02a5e30b323eb19b1b0eb2dcf17027f878
* Merge from donut.Daisuke Miyakawa2009-05-201-4/+9
|
* AI 147994: First cut of CharsetUtils, a utility class that aims toDan Bornstein2009-04-291-0/+169
help with vendor-specific encoding name interpretation. BUG=1820922 Automated import of CL 147994