I have a windows IIS server working with PHP. The user inserts a word via an HTML form, it goes to PHP and then PHP calls a COM dll (vb6) function passing the word to the function as a utf8 string.

Everything goes fine, until an input contains capital Greek letters with dialytika such as http://unicode-table.com/en/03AA/

When that happens, a PHP warning comes telling me: [07-Jul-2016 14:15:50 Europe/Athens] PHP Warning: Unknown: Could not convert string to unicode: No mapping for the Unicode character exists in the target multi-byte code page. and a different scrambled string passes.

for example, the word μαϊου will work fine but the word μαΪου will produce the warning.

here is what the .dll function sees in both cases: enter image description here

I tried playing with php settings a bit, but nothing changed. Current settings for php.ini (the ones I changed from default to the following ones - but still nothing):

default_charset = "utf-8"
mbstring.internal_encoding = UTF-8

I'm not sure what I must do to fix this issue. Thank you in advance for any insight.

  • That's indeed a strange one, as both chars are in the same unicode block and have a 2-byte-length ... I couldn't replicate any problem with this chars on my local PHP installation. Maybe you can work around the problem, through base64 encoding the string for the transfer? Sorry for not being very helpful. ;-) – s1lv3r Jul 7 '16 at 12:48
  • Please consider sharing a code snippet where PHP calls a COM dll (vb6) function passing the word to the function as a utf8 string (do you call a common dll or home-made one?). Moreover: as far as possible, please prefer to post data in code snippets instead of images. Your example shows ϊ Greek Small Letter Iota With Dialytika in μαϊου (UTF-8 byte sequence 206,138) but byte sequence 206, 144 shown in image is UTF-8 representation of ΐ Greek Small Letter Iota With Dialytika And Tonos. – JosefZ Aug 18 '16 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.