DRF: CSVを送信するするときに WindowsだとBOMをつけないとExcelで文字化けする問題

BOM(byte order mark) ファイルの先頭3バイトが ‘EF BB BF’ の UTF-8 rest_framework_csv rendererで、 コンテキストの encoding を判定している encodingに utf-8-sig を 指定する viewset: get_renderer_context をオーバーライドする 1 2 3 4 5 6 7 8 9 10 11 def get_renderer_context(self): """(override)""" context = super().get_renderer_context() # ここで、以下の条件の時に utf-8-sigにセット # 1) text/csv を求めている # 2) utf-8 でエンコードが指定されている(デフォルト) if self.request.META.get('HTTP_ACCEPT', '').startswith('text/csv'): context['encoding'] = 'utf-8-sig' return context 記事 bom付きutf-8に変換するnkfコマンド PythonでUTF-8 with BOMを開く Declaring character encodings in HTML The byte-order mark (BOM) in HTML Accept-Encoding HttpRequest.META

2021年4月24日 · 1 分

XCode: A valid provisioning profile for this executable was not found

原因 時間がおかしい(有効期限切れ) Legacy Build System にする (File >Project Settings...>Build System) (今回はこれ) テスト実機端末のスキーマがおかしい(Products > Schema > Edit Schema で Run, Profile の Build Configuration を DEBUG にする) ~/Library/MobileDevice/Provisioning Profiles 1 2 3 4 % ls -l ~/Library/MobileDevice/Provisioning\ Profiles total 456 -rw-r--r-- 1 hdknr staff 10352 4 17 13:52 0179a51b-7303-4fef-b1a0-4a3cf541b737.mobileprovision ..... 記事 【Xcode】ビルドは成功するが、実機にインストールできない問題 エラー:A valid provisioning prof… の対処法 Unable to install iOS app on device. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402653179 Easy fix! “A valid provisioning profile for this executable was not found” A valid provisioning profile for this executable was not found

2021年4月24日 · 1 分

gistpad-scratch

‎‎​

2021年4月22日 · 1 分

Windows Termnal

https://docs.microsoft.com/ja-jp/windows/terminal/customize-settings/color-schemes https://qiita.com/y-tsutsu/items/833020344aa03539856e

2021年2月26日 · 1 分

Django Simple Docker File

% tree . -I '__*|db*' . ├── Dockerfile ├── poetry.lock ├── pyproject.toml └── web ├── blogsite │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── manage.py └── pages ├── admin.py ├── apps.py ├── migrations ├── models.py ├── tests.py ├── urls.py └── views.py 4 directories, 14 files

2021年2月19日 · 1 分

2020-11-30

1 2 3 const logger = require('electron-log'); logger.log(`${logger.transports.file.getFile()}`) C:\Users\hdknr\AppData\Roaming\electron-osc-js\logs\main.log

2020年11月30日 · 1 分

Windows 関連

Setting up WSL 2 for Web Development https://qiita.com/v2okimochi/items/f53edcf79a4b71f519b1 https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack

2020年11月21日 · 1 分

OSC

https://www.music.mcgill.ca/~gary/306/week9/osc.html http://opensoundcontrol.org/ https://pypi.org/project/python-osc/ https://techracho.bpsinc.jp/katayama-yuuki/2017_07_13/42884 https://github.com/colinbdclark/osc.js https://github.com/ValdemarOrn/SharpOSC

2020年11月17日 · 1 分

雪国のクリームシチュールー

雪国のクリームシチュールー > 雪国のクリームシチュールー 170g

2019年1月16日 · 1 分

王子

パン ロワンモンターニュ (王子本町)

2018年11月29日 · 1 分