The following problem arose when the qr code generation module was connected, https://github.com/monospaced/angular-qrcode to the project, which would not be done when entering Russian letters, the resulting qr code is interpreted in the wrong encoding.
The js file is stored in utf-8 encoding. Example: "Hello world" is obtained as "? @ 825B <8 @".
The decoder says that it is 7-bit ASCII → KOI8-U + KOI8-R → ISO-8859-5 , but I don’t understand how it is. I tried to save the file in different encodings at the output I get - "??????????".
In the demo example to the module, there are no problems with Russian letters, tell me in which direction to dig.
An example of code like this:
<div class="block-qr"> <qrcode version="8" error-correction-level="Medium" size="400" data="{{vm.data}}" href="{{var}}" download></qrcode> </div> <form class="block-form"> <div class="form-group"> <label>Заголовок</label> <input type="text" class="form-control" placeholder="Заголовок" ng-model="vm.title"> </div> <div class="form-group"> <label>Организация</label> <input type="text" class="form-control" placeholder="Организация" ng-model="vm.org"> </div> <div class="form-group"> <label></label>Телефон</label> <input type="text" class="form-control" placeholder="Телефон" ng-model="vm.phone"> </div> <div class="form-group"> <label for="exampleInputEmail1">Email</label> <input type="email" class="form-control" placeholder="Email" id="exampleInputEmail1" ng-model="vm.emails"> </div> <div class="form-group"> <label>Сайт</label> <input type="text" class="form-control" placeholder="Сайт" ng-model="vm.site"> </div> <button type="submit" class="btn btn-default" ng-click="vm.concat()">Сгенерировать</button> </form> And controller:
function concat() { vm.data = 'Title: ' + vm.title + '\nOrg: ' + vm.org + '\nPhone number: ' + vm.phone + '\nEmail: ' + vm.emails + '\n ' + vm.site; return vm.data; } Actually for the Latin no problems, everything works fine.
qrcode? - Stepan Kasyanenko