Open ttanimichi opened 2 years ago
Hi @ttanimichi, including emojis in text overlays can be done by double encoding the emoji as explained here:https://support.cloudinary.com/hc/en-us/articles/360003457091-How-to-overlay-emojis-in-images. Please note that not all emojis are supported. You can refer here for the list of supported emojis: https://www.piliapp.com/symbol/
@michalkcloudinay Thank you for your reply. Not only emojis but also some kind of chinese characters seem to cause the same error.
foo('漢字') # Most of chinese characters are No Problem
foo('あいうえお') # Japanese Hiragana letters are also No Problem
foo('𩸽') # => 400 Bad Request (OpenURI::HTTPError)
foo('𡈽') # => 400 Bad Request (OpenURI::HTTPError)
foo('𠀋') # => 400 Bad Request (OpenURI::HTTPError)
I found that the bytesize of 🍺
, 𩸽 (Unicode: U+29E3D)
, 𡈽
and 𠀋
are four.
$ irb
irb(main):001:0> '𩸽'.bytesize
=> 4
irb(main):002:0> '🍺'.bytesize
=> 4
irb(main):003:0> '𡈽'.bytesize
=> 4
irb(main):004:0> '𠀋'.bytesize
=> 4
Probably, overlay texts of 4-bytesize Unicode characters cause this error. Isn't it a bug of Cloudinary API, is it?
One of my best friend Mr. 𡈽田 (Tsuchida) can't display his name as overlay texts since his family name contains 𡈽
, which is a 4-bytesize Unicode character. It's so much trouble for him...
Hi @ttanimichi, for 4-bytesize Unicode characters you would need to use a double encoding. For example: https://res.cloudinary.com/demo/image/upload/o_30/l_text:Arial_58:%2520%25F0%25A9%25B8%25BD/couple.jpg Let us know if this works for you.
@michalkcloudinay Thanks! I'll try it next week and let you know the result
Great! Let us know how it goes.
Hi @ttanimichi - just wanted to follow up on this to see if you had a chance to test this and if it worked for you?
Some kind of overlay texts generate urls which cause
400 Bad Request
Describe the bug in a sentence or two.
Issue Type (Can be multiple)
Operating System
Environment and Libraries (fill in the version numbers)