mirror of
https://github.com/glfw/glfw.git
synced 2024-11-23 10:35:10 +00:00
Cocoa: Fix non-BMP Unicode codepoint input
Supplimentary Plane codepoints were reported as UTF-16 surrogate pairs.
Fixes #1635.
(cherry picked from commit ad9eb768c9
)
This commit is contained in:
parent
26aaa007e0
commit
9cae95faa3
@ -121,6 +121,8 @@ information on what to include when reporting a bug.
|
|||||||
- Bugfix: Some extension loader headers did not prevent default OpenGL header
|
- Bugfix: Some extension loader headers did not prevent default OpenGL header
|
||||||
inclusion (#1695)
|
inclusion (#1695)
|
||||||
- [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169)
|
- [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169)
|
||||||
|
- [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
|
||||||
|
(#1635)
|
||||||
- [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636)
|
- [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636)
|
||||||
- [X11] Bugfix: Xlib errors caused by other parts of the application could be
|
- [X11] Bugfix: Xlib errors caused by other parts of the application could be
|
||||||
reported as GLFW errors
|
reported as GLFW errors
|
||||||
@ -341,6 +343,7 @@ skills.
|
|||||||
- Ryogo Yoshimura
|
- Ryogo Yoshimura
|
||||||
- Lukas Zanner
|
- Lukas Zanner
|
||||||
- Andrey Zholos
|
- Andrey Zholos
|
||||||
|
- Aihui Zhu
|
||||||
- Santi Zupancic
|
- Santi Zupancic
|
||||||
- Jonas Ådahl
|
- Jonas Ådahl
|
||||||
- Lasse Öörni
|
- Lasse Öörni
|
||||||
|
@ -731,15 +731,25 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
else
|
else
|
||||||
characters = (NSString*) string;
|
characters = (NSString*) string;
|
||||||
|
|
||||||
const NSUInteger length = [characters length];
|
NSRange range = NSMakeRange(0, [characters length]);
|
||||||
for (NSUInteger i = 0; i < length; i++)
|
while (range.length)
|
||||||
|
{
|
||||||
|
uint32_t codepoint = 0;
|
||||||
|
|
||||||
|
if ([characters getBytes:&codepoint
|
||||||
|
maxLength:sizeof(codepoint)
|
||||||
|
usedLength:NULL
|
||||||
|
encoding:NSUTF32StringEncoding
|
||||||
|
options:0
|
||||||
|
range:range
|
||||||
|
remainingRange:&range])
|
||||||
{
|
{
|
||||||
const unichar codepoint = [characters characterAtIndex:i];
|
|
||||||
if ((codepoint & 0xff00) == 0xf700)
|
if ((codepoint & 0xff00) == 0xf700)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_glfwInputChar(window, codepoint, mods, plain);
|
_glfwInputChar(window, codepoint, mods, plain);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)doCommandBySelector:(SEL)selector
|
- (void)doCommandBySelector:(SEL)selector
|
||||||
|
Loading…
Reference in New Issue
Block a user