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

gucong3000 opened this Issue Aug 1, 2018 · 3 comments


None yet
2 participants

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:

<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 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 class="auth-protocol fs-24">
      登录即表示同意 <text bindtap="jumpToTerms"  data-url="" class="auth-terms">《街电用户协议》</text>

This comment has been minimized.


balupton commented Aug 17, 2018

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


This comment has been minimized.

gucong3000 commented Aug 17, 2018

Is that text UTF8 or UTF16 or something else?


I was update this file to =>


This comment has been minimized.


balupton commented Nov 7, 2018

Ah right, it is the 登录即表示同意 characters that are throwing it off. I'll add wxml to 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