|
|
Chromium Code Reviews|
Created:
4 years, 4 months ago by jsbell Modified:
4 years, 4 months ago CC:
chromium-reviews, blink-reviews-w3ctests_chromium.org, tfarina, blink-reviews, blink-reviews-wtf_chromium.org, jshin+watch_chromium.org, Mikhail Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionText Encoding: Fix "stop on error" for ICU-based codecs
Handling of errors when the "stopOnError" flag was set in
TextCodecICU::decode() was incorrect; the replacement character was
always emitted instead. Align the initialization of the ICU error
callback with what i18n/icu_string_conversions.cc does.
BUG=607540
R=jshin@chromium.org
Committed: https://crrev.com/005842b420cace28845fc552ef6da8086fe527a5
Cr-Commit-Position: refs/heads/master@{#412170}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Remove explicit default code path #
Messages
Total messages: 25 (13 generated)
The CQ bit was checked by jsbell@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
jshin@ please take a look? https://codereview.chromium.org/2235453002/diff/1/third_party/WebKit/Source/w... File third_party/WebKit/Source/wtf/text/TextCodecICU.cpp (right): https://codereview.chromium.org/2235453002/diff/1/third_party/WebKit/Source/w... third_party/WebKit/Source/wtf/text/TextCodecICU.cpp:318: ucnv_setToUCallBack(m_converter, UCNV_TO_U_CALLBACK_SUBSTITUTE, 0, &m_savedAction, &m_savedContext, &err); Maybe we only want the `if (m_shouldStopOnEncodingErrors)` branch, and do nothing if !m_shouldStopOnEncodingErrors The ICU docs are terrible for the combination of UCNV_TO_U_CALLBACK_SUBSTITUTE / UCNV_SUB_STOP_ON_ILLEGAL - it's unclear to me what that even means, even though it's called out explicitly as a valid combination.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
jshin@ - ping!
LGTM https://codereview.chromium.org/2235453002/diff/1/third_party/WebKit/Source/w... File third_party/WebKit/Source/wtf/text/TextCodecICU.cpp (right): https://codereview.chromium.org/2235453002/diff/1/third_party/WebKit/Source/w... third_party/WebKit/Source/wtf/text/TextCodecICU.cpp:318: ucnv_setToUCallBack(m_converter, UCNV_TO_U_CALLBACK_SUBSTITUTE, 0, &m_savedAction, &m_savedContext, &err); On 2016/08/09 22:27:24, jsbell wrote: > Maybe we only want the `if (m_shouldStopOnEncodingErrors)` branch, and do > nothing if !m_shouldStopOnEncodingErrors > > The ICU docs are terrible for the combination of UCNV_TO_U_CALLBACK_SUBSTITUTE / > UCNV_SUB_STOP_ON_ILLEGAL - it's unclear to me what that even means, even though > it's called out explicitly as a valid combination. Indeed, confusing. https://cs.chromium.org/chromium/src/third_party/icu/source/common/unicode/uc... helps. For 'ToUnicode' direction, UCNV_SUB_STOP_ON_ILLEGAL means that the conversion should stop right away when coming across a byte/byte sequence NOT allowed by the current charset (that is, *illegal* or outside the range). However, 'valid but unassigned' byte sequences will STILL be substituted per UCNV_TO_U_CALLBACK_SUBSTITUTE,. Depending on how tightly valid byte-ranges are defined, there may or may not be byte sequences falling into the second group (valid but unassigned)> . Because the encoding spec does not make a distinction between the former and the latter, I think we don't need 'else' branch.
The CQ bit was checked by jsbell@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
jshin@ - updated the CL to not have the "else" paths. Can you do one more review?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
On 2016/08/12 18:05:50, jsbell wrote: > jshin@ - updated the CL to not have the "else" paths. Can you do one more > review? LGTM
The CQ bit was checked by jsbell@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
jsbell@chromium.org changed reviewers: + haraken@chromium.org
haraken@ - can you review as wtf OWNER ? (and cq if lg?)
LGTM
The CQ bit was checked by haraken@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Text Encoding: Fix "stop on error" for ICU-based codecs Handling of errors when the "stopOnError" flag was set in TextCodecICU::decode() was incorrect; the replacement character was always emitted instead. Align the initialization of the ICU error callback with what i18n/icu_string_conversions.cc does. BUG=607540 R=jshin@chromium.org ========== to ========== Text Encoding: Fix "stop on error" for ICU-based codecs Handling of errors when the "stopOnError" flag was set in TextCodecICU::decode() was incorrect; the replacement character was always emitted instead. Align the initialization of the ICU error callback with what i18n/icu_string_conversions.cc does. BUG=607540 R=jshin@chromium.org Committed: https://crrev.com/005842b420cace28845fc552ef6da8086fe527a5 Cr-Commit-Position: refs/heads/master@{#412170} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/005842b420cace28845fc552ef6da8086fe527a5 Cr-Commit-Position: refs/heads/master@{#412170} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
