Repository navigation
住所表示番号の13けた目にアルファベットが来ると落ちる不具合などを修正 - #6
Merged
Merged
Conversation
- 住所表示番号を13けたで切り捨て、13けた目がアルファベットの場合は 英字用制御コードのみ残すようにした(マニュアル p20) - 郵便番号の検証で末尾の改行や ASCII 以外の数字を受け付けないようにした - 住所の大文字変換を実行環境のカルチャに依存しないようにした - 全角ハイフン(U+FF0D)を半角に変換するようにした - 描画中に例外が出た場合に生成済みのイメージを破棄するようにした - Symbols を外部から書き換えられないようにした Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
住所表示番号の 13 けた目(郵便番号と合わせて 20 けた目)にアルファベットが来ると、
IndexOutOfRangeExceptionで落ちる不具合を修正しました。あわせて、コードレビューで見つかった既存の不具合も修正しています。修正内容
ConvertCCodeをSelectManyとTake(13)で書き直し、境界チェックをなくしたBarCode.cs\A[0-9]{7}\zに変更。これまでは末尾に改行がある場合や、アラビア数字など ASCII 以外の数字が検証を通り、KeyNotFoundExceptionになっていたBarCode.csToUpperInvariant()に変更。tr-TR 環境では英字iがİになり、黙って消えていたBarCode.cs-(U+FF0D)を半角に変換するようにした。これまでは123-4567が例外になっていたBarCode.csBitmap/SKBitmapを破棄するようにしたSymbolsをコピーして読み取り専用で保持するようにした。これまではstring[]にキャストすると書き換えられたCustomerBarCode.csテスト
dotnet testで 94 件すべて成功。91000673-80-25 CC1 9 1-2 CC1)を期待値にしている。対応しなかったもの
「A棟B号」のように離れた英字 1 文字同士が
ABとしてつながってしまう件。1.x と同じ動きで、マニュアルの例(J1ビル2-B)とは合っているため、仕様を確認してから判断する。🤖 Generated with Claude Code
https://claude.ai/code/session_01HNb8H3ydQTR8dWU8d28osE