* Fixed #6839 Wrong text encoding in iMessage * Update ChangeLog
This commit is contained in:
parent
70d67040b7
commit
7128f8f5f0
5 changed files with 97 additions and 11 deletions
|
|
@ -8,6 +8,7 @@ Bug fixes:
|
||||||
- #6920 Windows Installer checksums
|
- #6920 Windows Installer checksums
|
||||||
- #6921 Handling pre-main window creation status notifications
|
- #6921 Handling pre-main window creation status notifications
|
||||||
- #6922 macOS CI build
|
- #6922 macOS CI build
|
||||||
|
- #6927 Text copied and pasted between Windows and Mac OS converts to japanese
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
- #6912 Removes UI for Screen Saver Sync and Files Drag and Drop
|
- #6912 Removes UI for Screen Saver Sync and Files Drag and Drop
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#include "platform/OSXClipboard.h"
|
#include "platform/OSXClipboard.h"
|
||||||
|
|
||||||
#include "synergy/Clipboard.h"
|
#include "synergy/Clipboard.h"
|
||||||
|
#include "platform/OSXClipboardUTF8Converter.h"
|
||||||
#include "platform/OSXClipboardUTF16Converter.h"
|
#include "platform/OSXClipboardUTF16Converter.h"
|
||||||
#include "platform/OSXClipboardTextConverter.h"
|
#include "platform/OSXClipboardTextConverter.h"
|
||||||
#include "platform/OSXClipboardBMPConverter.h"
|
#include "platform/OSXClipboardBMPConverter.h"
|
||||||
|
|
@ -36,11 +37,10 @@ OSXClipboard::OSXClipboard() :
|
||||||
{
|
{
|
||||||
m_converters.push_back(new OSXClipboardHTMLConverter);
|
m_converters.push_back(new OSXClipboardHTMLConverter);
|
||||||
m_converters.push_back(new OSXClipboardBMPConverter);
|
m_converters.push_back(new OSXClipboardBMPConverter);
|
||||||
|
m_converters.push_back(new OSXClipboardUTF8Converter);
|
||||||
m_converters.push_back(new OSXClipboardUTF16Converter);
|
m_converters.push_back(new OSXClipboardUTF16Converter);
|
||||||
m_converters.push_back(new OSXClipboardTextConverter);
|
m_converters.push_back(new OSXClipboardTextConverter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OSStatus createErr = PasteboardCreate(kPasteboardClipboard, &m_pboard);
|
OSStatus createErr = PasteboardCreate(kPasteboardClipboard, &m_pboard);
|
||||||
if (createErr != noErr) {
|
if (createErr != noErr) {
|
||||||
LOG((CLOG_DEBUG "failed to create clipboard reference: error %i", createErr));
|
LOG((CLOG_DEBUG "failed to create clipboard reference: error %i", createErr));
|
||||||
|
|
@ -121,16 +121,18 @@ OSXClipboard::add(EFormat format, const String & data)
|
||||||
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
|
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
|
||||||
PasteboardItemID itemID = 0;
|
PasteboardItemID itemID = 0;
|
||||||
|
|
||||||
PasteboardPutItemFlavor(
|
if (dataRef) {
|
||||||
m_pboard,
|
PasteboardPutItemFlavor(
|
||||||
itemID,
|
m_pboard,
|
||||||
flavorType,
|
itemID,
|
||||||
dataRef,
|
flavorType,
|
||||||
kPasteboardFlavorNoFlags);
|
dataRef,
|
||||||
|
kPasteboardFlavorNoFlags);
|
||||||
|
|
||||||
LOG((CLOG_DEBUG "added %d bytes to clipboard format: %d", data.size(), format));
|
CFRelease(dataRef);
|
||||||
|
LOG((CLOG_DEBUG "added %d bytes to clipboard format: %d", data.size(), format));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
19
src/lib/platform/OSXClipboardUTF8Converter.cpp
Normal file
19
src/lib/platform/OSXClipboardUTF8Converter.cpp
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include "OSXClipboardUTF8Converter.h"
|
||||||
|
|
||||||
|
CFStringRef
|
||||||
|
OSXClipboardUTF8Converter::getOSXFormat() const
|
||||||
|
{
|
||||||
|
return CFSTR("public.utf8-plain-text");
|
||||||
|
}
|
||||||
|
|
||||||
|
String
|
||||||
|
OSXClipboardUTF8Converter::doFromIClipboard(const String& data) const
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
String
|
||||||
|
OSXClipboardUTF8Converter::doToIClipboard(const String& data) const
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
30
src/lib/platform/OSXClipboardUTF8Converter.h
Normal file
30
src/lib/platform/OSXClipboardUTF8Converter.h
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 2012-2016 Symless Ltd.
|
||||||
|
* Copyright (C) 2004 Chris Schoeneman
|
||||||
|
*
|
||||||
|
* This package is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* found in the file LICENSE that should have accompanied this file.
|
||||||
|
*
|
||||||
|
* This package is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "platform/OSXClipboardAnyTextConverter.h"
|
||||||
|
|
||||||
|
class OSXClipboardUTF8Converter : public OSXClipboardAnyTextConverter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual CFStringRef getOSXFormat() const;
|
||||||
|
private:
|
||||||
|
virtual String doFromIClipboard(const String&) const;
|
||||||
|
virtual String doToIClipboard(const String&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 2012-2016 Symless Ltd.
|
||||||
|
* Copyright (C) 2011 Nick Bolton
|
||||||
|
*
|
||||||
|
* This package is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* found in the file LICENSE that should have accompanied this file.
|
||||||
|
*
|
||||||
|
* This package is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "platform/OSXClipboardUTF8Converter.h"
|
||||||
|
#include "test/global/gtest.h"
|
||||||
|
|
||||||
|
TEST(OSXClipboardUTF8ConverterTests, test_Format)
|
||||||
|
{
|
||||||
|
OSXClipboardUTF8Converter converter;
|
||||||
|
EXPECT_EQ(IClipboard::kText, converter.getFormat());
|
||||||
|
EXPECT_EQ(CFSTR("public.utf8-plain-text"), converter.getOSXFormat());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(OSXClipboardUTF8ConverterTests, test_readWriteClipboard)
|
||||||
|
{
|
||||||
|
OSXClipboardUTF8Converter converter;
|
||||||
|
EXPECT_EQ("test data\r", converter.fromIClipboard("test data\n"));
|
||||||
|
EXPECT_EQ("test data\n", converter.toIClipboard("test data\r"));
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue