< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #15839 has been updated by jeremyevans0 (Jeremy Evans).
File mixed-encoding-heredoc-fix-v2.patch added
After additional analysis, I found that I only needed to add one line to my initial patch to fix it to work with both `\u` before `\x` and `\u` after `\x`. With the attached patch (which supersedes the previous patches):
```
$ ruby -e '#encoding: cp932
p((<<-STR))
\u1234
\xe9\x9d
STR
'
-e:4: UTF-8 mixed within Windows-31J source
\xe9\x9d
$ ruby -e '#encoding: cp932
p((<<-STR))
\xe9\x9d
\u1234
STR
'
-e:4: UTF-8 mixed within Windows-31J source
\u1234
-e:2: syntax error, unexpected end-of-input, expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
```
----------------------------------------
Bug #15839: mixed encoding heredoc should be a syntax error regardless the order
https://bugs.ruby-lang.org/issues/15839#change-78036
* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED
----------------------------------------
This heredoc isn't a syntax error,
```ruby
#encoding: cp932
p <<-STR
\xe9\x9d
\u1234
STR
```
whereas this is.
```ruby
#encoding: cp932
"
\xe9\x9d
\u1234
"
```
---Files--------------------------------
mixed-encoding-heredoc-fix.patch (5.28 KB)
mixed-encoding-heredoc-reverse-order-fix.patch (1.58 KB)
mixed-encoding-heredoc-fix-v2.patch (5.64 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>