#Spatie Crypto package Problem

2 messages · Page 1 of 1 (latest)

barren ferry
#

Hello I have the problem that the encrypted message from the Spatie Crypto Package im trying to store into the database but I receive the following Database Query Error:

"SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE4\x0E/\xDF s...' for column 'message' at row 1 (SQL: insert into `ticket_messages` (`ticket_id`, `user_id`, `message`, `updated_at`, `created_at`) values (0, 1, T\x12õ\x0E/▀ s;Ts­õ(╗Q üê.!/Ktµl²@Óß­ô┤õ\x0Eu╚^æ÷\x1AÓ­\x14ÑÉwÔ\x11¾ÀP^#ê9ÀIÔAj╦░@¶\f·íA\x107Jëä\x1Aû<░Í­iÅ"Wf¹éÖ"\x10~ï=┘Æ\x13ã$Ç£\x17+¯³å\f¸\x06´─Sl:5B│f=.╠]¶H\x08ãcät¯&l═âB¡BX█`+‗Á'‗Þ░b╬┴(µYÈ\O┴ë╩Í┴ÚÉà6╝WÂcL\x1FXÍ,╝!;¹&I=Ú\x17X\x00ÌéF═_µ½y├\x07Ê╔Nl8g\x03ôÎ\x1EÞ´¡¹´S¬>Hgê└-¨ù>êm+£³é┴p\x12Tn£0sB_ì\x07À\x0F\x18▀╩Äı}\x13÷:Ë¿\x00c\f╣, 2023-01-08 16:47:41, 2023-01-08 16:47:41))"```

how can I fix this and store the encrypted message in my database?
summer swift
#

Your database expects a string, and you're passing binary data. If you want to store it as text, you could base64_encode the data