IPC.cr now correctly handles strings with accents (size vs bytesize).
parent
2a46689a77
commit
6d751ad933
|
@ -1,5 +1,5 @@
|
|||
name: ipc
|
||||
version: 0.2.0
|
||||
version: 0.2.1
|
||||
|
||||
authors:
|
||||
- Philippe Pittoli <karchnu@karchnu.fr>
|
||||
|
|
|
@ -52,7 +52,7 @@ class IPC
|
|||
end
|
||||
|
||||
def write(fd : Int, string : String)
|
||||
self.write(fd, string.to_unsafe, string.size.to_u64)
|
||||
self.write(fd, string.to_unsafe, string.bytesize.to_u64)
|
||||
end
|
||||
|
||||
def write(fd : Int, buffer : UInt8*, buflen : UInt64)
|
||||
|
@ -73,7 +73,7 @@ class IPC
|
|||
end
|
||||
|
||||
def schedule(fd : Int32, string : String)
|
||||
self.schedule(fd, string.to_unsafe, string.size.to_u64)
|
||||
self.schedule(fd, string.to_unsafe, string.bytesize.to_u64)
|
||||
end
|
||||
|
||||
def schedule(fd : Int32, buffer : Array(UInt8), buflen : Int32)
|
||||
|
|
|
@ -11,7 +11,7 @@ module IPCMessage
|
|||
property payload : Bytes
|
||||
|
||||
def initialize(string : String)
|
||||
@payload = Bytes.new string.to_unsafe, string.size
|
||||
@payload = Bytes.new string.to_unsafe, string.bytesize
|
||||
end
|
||||
|
||||
def initialize(@payload)
|
||||
|
|
Loading…
Reference in New Issue