Question is in what format are they received/showed in VKontakte chat in Miranda...
http://miranda-ng.org/distr/addons/Smileys/vk_emoji_local.zip
I hope, that would help (470 WhatsApp smileys, msl file included):Unfortunately it doesn't work, at least not for me.
Did you try some algorithm to convert hexademical picture names to unicode symbols?Well, I've just listed names of the smiley files, pasted them in MS Word and used alt+X on each code to convert them. Unfortunately, I don't have any other info about what combinations are used for each of the smiley in WhatsApp.
Actually I have tried to do it manually from scratchThat's one of the ways, of course, although it's gonna take forever. And I would leave my symbol specifications untouched, adding those other symbols to them rather than replacing them. That would make the pack work both ways with no problem, like you did in the previous post.
I have tested your pack and figured out a problem: sending smilies from miranda to of. client works fine, but it is not so fine backwards.Just now out of curiosity tried sending a bunch of smileys to Miranda from the official Android app. All of them were displayed correctly. ???
Oh, and I'm using the 64-bit Miranda--not sure if this matters, just in case.Perhaps this is the case - I'm using 32 bit version. Didn't check it, but this made me come up with an idea - I have figured out that I only receive smileys with "em_" in their names correctly.
Don't know why the pack works fine for you - it just shouldn'tWell, the answer to this question is in the question itself. If everything is the same, you have to look for what is different, and that would be the reason for why it works for me and doesn't work for you.
I think that the first choice should be Unified UnicodeI guess we can only know for sure by testing ancient whatsapp clients... And that Shibuya emoji still bothers me :) Will leave it as it is for now, unless someone encounters any problems.
What do you mean by linear sorting?I believe he meant that now smileys are listed vertically (in columns), but it'd be more natural if they were located horizontally (in rows).
I believe he meant that now smileys are listed vertically (in columns), but it'd be more natural if they were located horizontally (in rows).Exactly! Couldn't find the right words ;D
Better be late than sorry - Aliror's smiley pack uploaded to serverActually original Alitor's pack was incomplete and unsorted. Many smileys lack alternative codes which leads to miranda not displaying smileys received from some official clients (from Nokia OS for sure). I recommend using my updated version (http://forum.miranda-ng.org/index.php?topic=104.msg8449#msg8449) (it is continuation of his work, I have credited it in msl).
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.jsoup.nodes.Document;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by bykov on 13.07.2015.
*/
public class EmojiProcessor {
private static final Map<String, HashMap <String, String>> protocols = new HashMap<>();
static {
protocols.put("BW", new HashMap<String, String>());
protocols.get("BW").put("name", "BW");
protocols.get("BW").put("index", "3");
protocols.put("Apple", new HashMap<String, String>());
protocols.get("Apple").put("name", "Apple");
protocols.get("Apple").put("index", "4");
protocols.put("Twit", new HashMap<String, String>());
protocols.get("Twit").put("name", "Twit");
protocols.get("Twit").put("index", "6");
}
public static void main(String[] args) throws java.io.IOException{
//Uncomment to use online version
//Document doc = Jsoup.connect("http://unicode.org/emoji/charts/full-emoji-list.html").get();
File input = new File("data/Full Emoji Data.html");
Document doc = Jsoup.parse(input, "UTF-8");
String rownumber;
String character;
// Clean files and prepare msl files
for (HashMap protocol: protocols.values()) {
FileUtils.cleanDirectory(new File("data/" + protocol.get("name").toString() + "/"));
Files.deleteIfExists(Paths.get("data/" + protocol.get("name").toString() + ".msl"));
prepareMSLFiles(protocol.get("name").toString());
}
// Parse html file extract images and compile msl file
for (Element table: doc.select("table")) {
for (Element row : table.select("tr")) {
// Ignore headers
if ("Count".equals(row.child(0).text()))
continue;
else {
rownumber = row.child(0).text();
character = row.child(2).text();
}
// For each table record save image and add record to msl file
for (HashMap protocol: protocols.values()) {
if (!row.child((Integer.parseInt(protocol.get("index").toString()))).children().isEmpty()) {
savePicture(protocol.get("name").toString(), getImageData(row, Integer.parseInt(protocol.get("index").toString())), rownumber);
addMSLRecord(protocol.get("name").toString(),getPNGName(rownumber),character);
}
}
}
}
}
// Decodes Base64 data tag and save it as png file
private static void savePicture(String protocol, String img, String name) throws java.io.IOException{
byte[] data = Base64.decodeBase64(img);
String filename = "data/" + protocol + "/" + getPNGName(name);
OutputStream stream = new FileOutputStream(filename);
stream.write(data);
stream.close();
}
// Remove 'data:image/png;base64,' from the beginning
private static String getImageData(Element row, int index) {
return row.child(index).child(0).attr("src").substring(22);
}
// Left pad 5 leading zeros to PNG filename
private static String getPNGName(String name) {
return String.format("%1$" + 5 + "s", name).replace(' ', '0') + ".png";
}
// Add record to msl file for specified picture file and character
private static void addMSLRecord(String protocol, String pngname, String character) throws java.io.IOException{
String filename = "data/" + protocol + ".msl";
OutputStreamWriter stream = new OutputStreamWriter(new FileOutputStream(filename, true), "UTF-8");
BufferedWriter out = new BufferedWriter(stream);
out.write("Smiley = \"" + protocol + "\\" + pngname + "\",0,\"" + character + "\"");
out.newLine();
out.close();
}
// Create msl file and add headers
private static void prepareMSLFiles(String protocol) throws java.io.IOException{
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();
String filename = "data/" + protocol + ".msl";
OutputStreamWriter stream = new OutputStreamWriter(new FileOutputStream(filename, true), "UTF-8");
BufferedWriter out = new BufferedWriter(stream);
out.write("Name = \"" + protocol + " Emoji set\""); out.newLine();
out.write("Author = \"Pavel Bykov\""); out.newLine();
out.write("Date = \"" + dateFormat.format(date) + "\""); out.newLine();
out.write("Version = \"1.0\""); out.newLine();
out.write("SelectionSize = 24, 24"); out.newLine();
out.write("WindowSize = 10, 8"); out.newLine();
out.newLine();
out.close();
}
}
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.jsoup.nodes.Document;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by bykov on 13.07.2015.
*/
public class EmojiProcessor {
private static final Map<String, HashMap <String, String>> protocols = new HashMap<>();
static {
protocols.put("BW", new HashMap<String, String>());
protocols.get("BW").put("name", "BW");
protocols.get("BW").put("index", "3");
protocols.put("Apple", new HashMap<String, String>());
protocols.get("Apple").put("name", "Apple");
protocols.get("Apple").put("index", "4");
protocols.put("Twit", new HashMap<String, String>());
protocols.get("Twit").put("name", "Twit");
protocols.get("Twit").put("index", "6");
}
public static void main(String[] args) throws java.io.IOException{
//Uncomment to use online version
//Document doc = Jsoup.connect("http://unicode.org/emoji/charts/full-emoji-list.html").get();
File input = new File("data/Full Emoji Data.html");
Document doc = Jsoup.parse(input, "UTF-8");
String rownumber;
String character;
// Clean files and prepare msl files
for (HashMap protocol: protocols.values()) {
FileUtils.cleanDirectory(new File("data/" + protocol.get("name").toString() + "/"));
//Files.deleteIfExists(Paths.get("data/" + protocol.get("name").toString() + ".msl"));
prepareMSLFiles(protocol.get("name").toString());
}
// Parse html file extract images and compile msl file
for (Element table: doc.select("table")) {
for (Element row : table.select("tr")) {
// Ignore headers
if ("Count".equals(row.child(0).text()))
continue;
else {
rownumber = row.child(0).text();
character = row.child(1).child(0).attr("name");
}
// For each table record save image and add record to msl file
for (HashMap protocol: protocols.values()) {
if (!row.child((Integer.parseInt(protocol.get("index").toString()))).children().isEmpty()) {
savePicture(protocol.get("name").toString(), getImageData(row, Integer.parseInt(protocol.get("index").toString())), rownumber);
addMSLRecord(protocol.get("name").toString(),getPNGName(rownumber),character);
}
}
}
}
}
// Decodes Base64 data tag and save it as png file
private static void savePicture(String protocol, String img, String name) throws java.io.IOException{
byte[] data = Base64.decodeBase64(img);
String filename = "data/" + protocol + "/" + getPNGName(name);
OutputStream stream = new FileOutputStream(filename);
stream.write(data);
stream.close();
}
// Remove 'data:image/png;base64,' from the beginning
private static String getImageData(Element row, int index) {
return row.child(index).child(0).attr("src").substring(22);
}
// Left pad 5 leading zeros to PNG filename
private static String getPNGName(String name) {
return String.format("%1$" + 5 + "s", name).replace(' ', '0') + ".png";
}
// Add record to msl file for specified picture file and character
private static void addMSLRecord(String protocol, String pngname, String character) throws java.io.IOException{
String filename = "data/" + protocol + ".msl";
Writer out = new OutputStreamWriter(new FileOutputStream(filename, true), "UTF-16LE");
out.append("Smiley = \"" + protocol + "\\" + pngname + "\",0,\"" + returnUnicodeChars(character) + "\"").append("\r\n");
out.close();
}
// Create msl file and add headers
private static void prepareMSLFiles(String protocol) throws java.io.IOException{
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();
String filename = "data/" + protocol + ".msl";
OutputStreamWriter stream = new OutputStreamWriter(new FileOutputStream(filename), "UTF-16LE");
BufferedWriter out = new BufferedWriter(stream);
// BOM
out.write("\ufeff");
// Header
out.write("Name = \"" + protocol + " Emoji set\""); out.newLine();
out.write("Author = \"Pavel Bykov\""); out.newLine();
out.write("Date = \"" + dateFormat.format(date) + "\""); out.newLine();
out.write("Version = \"1.0\""); out.newLine();
out.write("SelectionSize = 24, 24"); out.newLine();
out.write("WindowSize = 10, 8"); out.newLine();
out.newLine();
out.close();
}
private static String returnUnicodeChars(String character) {
String[] chars;
String returnchar = "";
chars = character.split("_");
for (int i=0; i<chars.length; i++) {
returnchar+=String.valueOf(Character.toChars(Integer.parseInt(chars[i],16)));
}
return returnchar;
}
}
1. Official Whatsapp pack is not full and has a lot of emoji's missedThe only emoji that are missing (can't be selected in the menu, but incoming/manually entered code transforms into the picture) in the official apps are "Shibuya 109", "!!", and "!?". If you are talking about emoji that are not supported at all by the official apps, there is no reason to include them to the pack, since the purpose of the pack is to provide compability with the official apps. Otherwise it will be not "whatsapp smileypack" but just another custom smileypack.
After some surfing found out, that all the work is already done and the only problem is how to reuse it for Miranda NG.I can't understand what are you trying to do. All the work is already done and adapted to Miranda.
including the smiley name in the MSL file tooReasonable. Will try to extract this also.
The only emoji that are missingUnfortunately, I'm receiving a lot of smileys from iOS WhatsApp client as squares. Most of them become visible with VK pack, but there is a problem while sending Smileys, since codes like "
Unfortunately, I'm receiving a lot of smileys from iOS WhatsApp client as squares.What pack do you use? Did you try this one (http://forum.miranda-ng.org/index.php?topic=104.msg8449#msg8449)?
What pack do you use? Did you try this one (http://forum.miranda-ng.org/index.php?topic=104.msg8449#msg8449)?This one works for most smileys, you are right. There was an error during second part unzipping related to e521.png file, however seems it affects nothing.
This one works for most smileys, you are right.Should work for 100% :) Please report if you find any issues.
There was an error during second part unzipping related to e521.png file, however seems it affects nothing.This is multi-volume archive (I had to split it due to forum limitations). Such archives should be opened by placing all the parts to the same folder and using only the first part. The error occures while trying to unzip other parts separately, no need to do it...
Smileys from the wiki plugins page are not workingOfcourse they aren't - I've told about it (http://forum.miranda-ng.org/index.php?topic=104.msg12151#msg12151) just before your fist post in this thread ???
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.jsoup.nodes.Document;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by bykov on 13.07.2015.
*/
public class EmojiProcessor {
private static final String outDir = "data/out/";
private static final Map<String, HashMap <String, String>> protocols = new HashMap<>();
static {
protocols.put("BW", new HashMap<String, String>());
protocols.get("BW").put("name", "BW");
protocols.get("BW").put("index", "3");
protocols.put("Apple", new HashMap<String, String>());
protocols.get("Apple").put("name", "Apple");
protocols.get("Apple").put("index", "4");
protocols.put("Andr", new HashMap<String, String>());
protocols.get("Andr").put("name", "Andr");
protocols.get("Andr").put("index", "5");
protocols.put("Twit", new HashMap<String, String>());
protocols.get("Twit").put("name", "Twit");
protocols.get("Twit").put("index", "6");
protocols.put("Wind", new HashMap<String, String>());
protocols.get("Wind").put("name", "Wind");
protocols.get("Wind").put("index", "7");
protocols.put("GMail", new HashMap<String, String>());
protocols.get("GMail").put("name", "GMail");
protocols.get("GMail").put("index", "8");
protocols.put("DCM", new HashMap<String, String>());
protocols.get("DCM").put("name", "DCM");
protocols.get("DCM").put("index", "9");
protocols.put("KDDI", new HashMap<String, String>());
protocols.get("KDDI").put("name", "KDDI");
protocols.get("KDDI").put("index", "10");
protocols.put("SB", new HashMap<String, String>());
protocols.get("SB").put("name", "SB");
protocols.get("SB").put("index", "11");
}
public static void main(String[] args) throws java.io.IOException{
//Uncomment to use online version
//Document doc = Jsoup.connect("http://unicode.org/emoji/charts/full-emoji-list.html").get();
File input = new File("data/Full Emoji Data.html");
Document doc = Jsoup.parse(input, "UTF-8");
String rownumber;
String character;
String tooltip;
// Clean files and prepare msl files
for (HashMap protocol: protocols.values()) {
FileUtils.deleteDirectory(new File(outDir + protocol.get("name").toString() + "/"));
new File(outDir + protocol.get("name").toString()).mkdir();
prepareMSLFiles(protocol.get("name").toString());
}
// Parse html file extract images and compile msl file
for (Element table: doc.select("table")) {
for (Element row : table.select("tr")) {
// Ignore headers
if ("Count".equals(row.child(0).text()))
continue;
else {
rownumber = row.child(0).text();
character = row.child(1).child(0).attr("name");
tooltip = row.child(12).text();
}
// For each table record save image and add record to msl file
for (HashMap protocol: protocols.values()) {
if (!row.child((Integer.parseInt(protocol.get("index").toString()))).children().isEmpty()) {
savePicture(protocol.get("name").toString(), getImageData(row, Integer.parseInt(protocol.get("index").toString())), rownumber);
addMSLRecord(protocol.get("name").toString(),getPNGName(rownumber),character, tooltip);
}
}
}
}
}
// Decode Base64 data tag and save it as png file
private static void savePicture(String protocol, String img, String name) throws java.io.IOException{
byte[] data = Base64.decodeBase64(img);
String filename = outDir + protocol + "/" + getPNGName(name);
OutputStream stream = new FileOutputStream(filename);
stream.write(data);
stream.close();
}
// Remove 'data:image/png;base64,' from the beginning
private static String getImageData(Element row, int index) {
return row.child(index).child(0).attr("src").substring(22);
}
// Left pad 5 leading zeros to PNG filename
private static String getPNGName(String name) {
return String.format("%1$" + 5 + "s", name).replace(' ', '0') + ".png";
}
// Add record to msl file for specified picture file and character
private static void addMSLRecord(String protocol, String pngname, String character, String tooltip) throws java.io.IOException{
String filename = outDir + protocol + ".msl";
Writer out = new OutputStreamWriter(new FileOutputStream(filename, true), "UTF-16LE");
out.append("Smiley = \"")
.append(protocol)
.append("\\")
.append(pngname)
.append("\",0,\"")
.append(returnUnicodeChars(character))
.append("\",\"")
.append(tooltip)
.append("\"\r\n");
out.close();
}
// Create msl file and add headers
private static void prepareMSLFiles(String protocol) throws java.io.IOException{
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();
String filename = outDir + protocol + ".msl";
OutputStreamWriter stream = new OutputStreamWriter(new FileOutputStream(filename), "UTF-16LE");
BufferedWriter out = new BufferedWriter(stream);
// BOM
out.write("\ufeff");
// Header
out.write("Name = \"" + protocol + " Emoji set\""); out.newLine();
out.write("Author = \"Pavel Bykov\""); out.newLine();
out.write("Date = \"" + dateFormat.format(date) + "\""); out.newLine();
out.write("Version = \"1.0\""); out.newLine();
out.write("SelectionSize = 24, 24"); out.newLine();
out.write("WindowSize = 10, 8"); out.newLine();
out.newLine();
out.close();
}
private static String returnUnicodeChars(String character) {
String[] chars;
String returnchar = "";
chars = character.split("_");
for (int i=0; i<chars.length; i++) {
returnchar+=String.valueOf(Character.toChars(Integer.parseInt(chars[i],16)));
}
return returnchar;
}
}
Thug, can't download the pack for updating on server "Page not found" error.Sorry, made an attachment. Thought of using VK as a file hosting and failed ;D Thanks!