Convert non-breaking spaces to spaces in Ruby

后端 未结 6 764
春和景丽
春和景丽 2020-12-15 03:56

I have cases where user-entered data from an html textarea or input is sometimes sent with \\u00a0 (non-breaking spaces) instead of spaces when encoded as utf-8

6条回答
  •  时光取名叫无心
    2020-12-15 04:41

    For the old versions of ruby (1.8.x), the fixes are the ones described in the question.

    This is fixed in the newer versions of ruby 1.9+.

提交回复
热议问题