mono / libgdiplus

C-based implementation of the GDI+ API
http://www.mono-project.com/
MIT License
334 stars 171 forks source link

Fix: an issue where Japanese characters are recognized as spaces #628

Closed s520 closed 4 years ago

s520 commented 4 years ago

This PR fix an issue where Japanese characters are recognized as spaces. (#627)

This fix does not recur issue (https://github.com/mono/mono/issues/8272) fixed by #370.

qmfrederik commented 4 years ago

@s520 Do you think you could include a unit test which covers your case and possible #8272? That way, we can make sure this doesn't accidentally regress next time somebody touches the code 😄 .

s520 commented 4 years ago

First of all, my problem does not occur unless the system language is Japanese. In English environment, the characters are â–¡ (white square), but the number of characters looks correct. I need to check the behavior of function GdipMeasureString due to differences in system languages.

s520 commented 4 years ago

Well, it's hard for me to add this unit test. Do you have a good idea?

qmfrederik commented 4 years ago

@s520 I'll have a look.

Just to be clear, I don't have commit rights to this repository, so I don't decide what gets merged and what not.

Since there have been various fixes for this piece of code which have had side-effects, I'd be nice to have some unit tests. I'll see if there's an easy way to get some set up.

marcinm100 commented 4 years ago

Unfortunately the problem from #8272 has returned.

s520 commented 4 years ago

@marcinm100 Does your problem occur under the same conditions as shown in https://github.com/mono/mono/issues/8272? I have confirmed that the problem does not recur under the conditions shown in https://github.com/mono/mono/issues/8272 with current master branch. Please indicate the conditions under which your problem occurs.

marcinm100 commented 4 years ago

@s520 Yes, my locale is set to en_US.UTF-8 and the problem occurs under the same conditions as in #8272.