Java Unicode unicodeChar(char a, char b, char c, char d)

Here you can find the source of unicodeChar(char a, char b, char c, char d)

Description

unicode Char

License

Open Source License

Declaration

private static final char unicodeChar(char a, char b, char c, char d) 

Method Source Code

//package com.java2s;
/*/*from   w ww  . j a  va2 s  .  c  o m*/
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

public class Main {
    private static final char unicodeChar(char a, char b, char c, char d) {
        return (char) ((c2i(a) << 12) + (c2i(b) << 8) + (c2i(c) << 4) + c2i(d));
    }

    private static final int c2i(char c) {
        if (c >= 'a' && c <= 'f')
            return 10 + (c - 'a');
        else if (c >= 'A' && c <= 'F')
            return 10 + (c - 'A');
        else
            return (c - '0');
    }
}

Related

  1. unicode(StringBuilder buf, char c)
  2. Unicode2ASCII(String unicode)
  3. unicode2Byte(String s)
  4. Unicode2GBK(String dataStr)
  5. unicode2native(String s)
  6. unicodeCodepointToString(char cp, boolean shortenIfPossible, String prefix, boolean upperCase)
  7. unicodeConvert(String str)
  8. unicodeCount(String sStr)
  9. unicodeEncode(String s)