Examples of UTF8Encoding


Examples of org.jcodings.specific.UTF8Encoding

                       qpencode(result, lCurElemString, occurrences);
                    }
                    break;
                case 'U' :
                    UTF8Encoding enc = UTF8Encoding.INSTANCE;
                    byte[] packedBytes = new byte[enc.maxLength() * occurrences];
                    int index = 0;
                   
                    while (occurrences-- > 0) {
                        if (listSize-- <= 0) {
                           throw runtime.newArgumentError(sTooFew);
                        }

                        IRubyObject from = list.eltInternal(idx++);
                        int code = from == runtime.getNil() ? 0 : RubyNumeric.num2int(from);

                        if (code < 0) {
                            throw runtime.newRangeError(
                                    "pack(U): value out of range");
                        }

                        int length = enc.codeToMbc(code, packedBytes, index);
                        result.append(packedBytes, index, length);
                        index += length;
                    }
                    break;
                case 'w' :
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.