PDF などの中にある一部の日本語の漢字が、見た目は同じだけど異なる謎の文字に変換されていることがある
- 例 1: https://www.mhlw.go.jp/content/10906000/000628667.pdf
- 「長野」と「長崎」の「長」が、
U+9577ではなく「⾧ (U+2FA7)」になっている
- 「長野」と「長崎」の「長」が、
- 例 2: https://www.dpri.kyoto-u.ac.jp/news/12739/
| #include"LIS3DHTR.h" | |
| LIS3DHTR<TwoWire> lis(I2C_MODE); | |
| void setup() { | |
| Serial.begin(115200); | |
| lis.begin(Wire1, LIS3DHTR_DEFAULT_ADDRESS); //I2C Address | |
| if (!lis) { | |
| Serial.println("ERROR"); | |
| while (1); |
| #! /usr/bin/env python3 | |
| """ A Python script for demostration of Hilbert transform.""" | |
| # Copyright (C) 2020 by Akira TAMAMORI | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. |
PDF などの中にある一部の日本語の漢字が、見た目は同じだけど異なる謎の文字に変換されていることがある
U+9577 ではなく「⾧ (U+2FA7)」になっている| Test Code | |
| ------ | |
| import wifiCfg | |
| import urequests | |
| import gc | |
| import micropython | |
| micropython.mem_info() | |
| print('Initial free: {} allocated: {}'.format(gc.mem_free(), gc.mem_alloc())) | |
| wifiCfg.autoConnect() |
| #include <iostream> | |
| // via: http://yasuda.homeip.net/insomnia/2013/10/icu-cc-unicode-library.html | |
| #include <unicode/schriter.h> | |
| #include <unicode/ustream.h> | |
| using UnicodeStringIterator = icu::StringCharacterIterator; | |
| int main() { | |
| /** msys2 の gcc だと(msys2 の gcc でしか試してないのでこう書いているが、gcc なら多分そうなる)ソースコードのエンコーディングが UTF-8 だと | |
| 以下の文字列は raw UTF-8 になる。 |
| #!/usr/bin/env python | |
| """ A Python script to produce fourier series animation of sawtooth wave.""" | |
| # Copyright (C) 2020 by Akira TAMAMORI | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. |
| # https://github.com/sipeed/MaixPy_scripts/blob/master/multimedia/speech_recognizer/speech_recognizer.py | |
| from Maix import I2S, GPIO | |
| from fpioa_manager import fm | |
| from modules import SpeechRecognizer | |
| import utime, time | |
| # register i2s(i2s0) pin | |
| fm.register(20, fm.fpioa.I2S0_IN_D0, force=True) | |
| fm.register(18, fm.fpioa.I2S0_SCLK, force=True) |
| fn a(_:u64,_:u64){print!("{}",0x50f0000003bb8u64)}fn b(_:u64,_:u64){}fn h<'a,'b,T>(_:&'a&'b(),v:&'b mut[T])->&'a mut[T]{v}#[inline(never)]fn g<'a,T:Copy>(x:T)->&'a mut[T]{let f:fn(_,_)->_=h;print!("{:p}",&x);f(&&(),&mut[x;0x100])}pub fn main(){let x=g(0u64);let y=g(if x.as_ptr()as u64>>1>0{a}else{b});x[4]+=0x18f8;y[4]("/bin/sh\0".as_ptr()as _,0)} |
| import lcd | |
| import image | |
| import time | |
| import uos | |
| lcd.init() | |
| lcd.rotation(2) #Rotate the lcd 180deg | |
| from Maix import I2S, GPIO | |
| from Maix import GPIO |
| #include <iostream> | |
| #include <fstream> | |
| #include <nlohmann/json.hpp> | |
| // for convenience | |
| using json = nlohmann::json; | |
| namespace ns { | |
| // a simple struct to model a person | |
| struct person { |