New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`istextorbinary.isText` returned a wrong result #9

Closed
gucong3000 opened this Issue Aug 1, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@gucong3000

gucong3000 commented Aug 1, 2018

#!/usr/bin/env node
'use strict';
const fs = require('fs');
const path = require('path');
const istextorbinary = require('istextorbinary');
const filePath = path.resolve('index.wxml');
istextorbinary.isText(filePath, fs.readFileSync(filePath), console.log);

I got false as result. but here is contents of src/components/Template/Auth/index.wxml:
index.zip

<template name="auth">
  <view class="auth-wrap">
    <view class="auth-logo box box-tb box-align-center">
      <image src="../../../images/link-logo.png" class="auth-logo-img"></image>
      <text class="auth-company-name fs-32">街电科技</text>
    </view>
    <view class="auth-desc box box-tb">
      <text class="fs-28 auth-desc-title">登录后开发者将获得以下权限</text>
      <text class="fs-26 auth-desc-detail box box-lr box-align-center">获取你的公开信息(昵称、头像等)</text>
    </view>
    <auth-button
      btn-open-type="{{btnOpenType}}"
      custom-data="{{customData}}"
      data-custom-data="{{customData}}"
      auth-btn-class="auth-page-class"
      bind:auth="onClickAuth">确认登录</auth-button>
    <view class="auth-protocol fs-24">
      登录即表示同意 <text bindtap="jumpToTerms"  data-url="https://appstatic.ankerjiedian.com/app/dist/term.html" class="auth-terms">《街电用户协议》</text>
    </view>
  </view>
</template>
@balupton

This comment has been minimized.

Member

balupton commented Aug 17, 2018

Interesting. Is that text UTF8 or UTF16 or something else?

@gucong3000

This comment has been minimized.

gucong3000 commented Aug 17, 2018

Is that text UTF8 or UTF16 or something else?

UTF8

I was update this file to => https://github.com/bevry/istextorbinary/files/2248159/index.zip

@balupton

This comment has been minimized.

Member

balupton commented Nov 7, 2018

Ah right, it is the 登录即表示同意 characters that are throwing it off. I'll add wxml to https://github.com/bevry/textextensions to fix this.

balupton added a commit that referenced this issue Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment